background image
C H A P T E R 2 2
Transport Interface
Using the Transport Interface
22-35
For example, the built-in Print transport uses the
protoTransportPrefs
proto
for its preferences view. Since the
ReceiveRequest
method does not exist in
the Print transport, the In Box preference element is not displayed, as shown in
Figure 22-10.
Figure 22-10
Print preferences
The Info button is included in the
protoTransportPrefs
template so you can
give the user access to About and Help views for the transport. The button is built
from the standard
protoInfoButton
proto. To include items on the Info picker,
you must provide handler methods in the
infoPrefs
slot of your transport
preferences view. The
protoTransportPrefs
template includes a handler for
the "Help" item that displays the system help book, open to the routing section.
You'll need to override this method if you want to provide your own help information.
You can add custom items to the Info picker by supplying
GenInfoAuxItems
and
DoInfoAux
methods in the
infoPrefs
frame. For more information about
these methods and how the Info button works, see "protoInfoButton" (page 6-10)
in Newton Programmer's Reference.
The
defaultConfiguration
slot in the
protoTransport
holds the initial
preferences associated with the transport. This slot is set up by default with a frame
holding an initial selection of preferences items. The child views of the
protoTransportPrefs
proto are designed to manipulate the slots in this frame.
If you want to override the default preferences frame, you need to construct an
identical one with different values. You can't use a
_proto
slot in your default
frame since the contents of the
defaultConfiguration
slot are stored in a
soup and
_proto
slots can't be stored in soup entries.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна