background image
C H A P T E R 1 9
Built-in Applications and System Data
Icons and the Extras Drawer
Using Extras Drawer Cursors
The Extras Drawer method
creates a cursor that can iterate over
parts (icons) in the Extras Drawer. You can create a cursor that iterates over parts in
a specific store, a particular folder of the Extras Drawer, a particular package, or a
combination of these criteria. This cursor is a normal soup cursor, as described in
Chapter 11, "Data Storage and Retrieval."
Entries returned by part cursors are subject to change. These entries should be
manipulated only with one of the following three Extras Drawer methods:
returns information about a part.
has the same effect as the user tapping the icon.
sets data in a part entry; see "Changing Icon Information."
Changing Icon Information
The Extras Drawer method
can be used to change the icon or
text under an icon. It can also change the
slot of an icon, which has the
effect of filing the icon. If the icon is a soup icon, you may also change the array of
soups that this icon represents and the application that owns these soups.
Adding a Soup Icon
If your application uses more than one soup or you want to file or move entire
soups through the soupervisor mechanism, you should consider using a soup icon,
so that only one icon appears in the Extras Drawer. You should store this icon in the
internal store, otherwise all the component soups will reappear when the external
store is removed. Also, you should give the icon a different package name from
your application in your call to
, both as the pkgName parameter
and in the
slot of the paramFrame parameter. Again, this is so that it is not
removed when your application is.
You add a soup icon to the Extras Drawer by calling its
Passing the symbol
for the first parameter specifies that the icon to
add is a soup icon.
The rest of this section provides sample code for installing a soup icon. Before
trying to understand this code, you should read the description of
(page 16-88) in Newton Programmer's Reference.
//Useful constants
constant kMySoupNamesArray := '["soup1:NDTS",
"soup2:NDTS", "soup3:NDTS" ];
constant kMySoupUserName := "Souper Thing";
DefConst('kSoupPackageName, "Soups:" & kPackageName);
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна