background image
C H A P T E R 1 9
Built-in Applications and System Data
Auxiliary Buttons
Figure 19-9
The Notes application with and without an auxiliary button
Using Auxiliary Buttons
You can add buttons to the status bars or other locations in the Notes and Names
applications. Your application may also use this mechanism to allow itself to be
are the functions that add and remove a
button from the auxiliary button registry; they are called by button providers.
Button providers can ignore the descriptions of the other functions, which are
called by button hosts.
Here is an example of registering a button with the Notes application:
{destApp: 'paperroll,// Add buttons to Notes
_proto: protoTextButton,
text: "Smile!",
viewBounds: RelBounds(0,0,40,10),
buttonClickScript: func() print("Cheese!")
This code added the auxiliary button shown in Figure 19-9.
The following code shows how this button should be removed:
You should be careful what assumptions you make about the environment where
the button will appear. The buttons may not be on a
or have a
slot available by inheritance, and the implementation details of the built-in
applications may well change in the future. Remember to check your assumptions
and catch exceptions.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна