Apple Newton Utilities User's Guide Page 711

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 710
CHAPTER 19
Built-in Applications and System Data
Auxiliary Buttons 19-37
Figure 19-9 The Notes application with and without an auxiliary button
Using Auxiliary Buttons 19
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
extended.
RegAuxButton and UnRegAuxButton 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:
RegAuxButton('|smileButton:PIEDTS|,
{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:
UnRegAuxButton('|smileButton:PIEDTS|);
You should be careful what assumptions you make about the environment where
the button will appear. The buttons may not be on a
protoStatusBar or have a
base 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.
Page view 710
1 2 ... 706 707 708 709 710 711 712 713 714 715 716 ... 941 942

Comments to this Manuals

No comments