Apple Newton Utilities User's Guide Page 497

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 496
CHAPTER 11
Data Storage and Retrieval
Using Newton Data Storage Objects 11-65
W ARNING
Any callback function registered by the RegSoupChange
function must not call either of the
RegSoupChange or
UnRegSoupChange functions.
The second argument to the RegSoupChange function can be any unique symbol
that identies the callback to be registered. If your application registers only one
callback function, you can just use your application symbol as the callback
identier (ID). A callback ID need only be unique within the registry that uses it.
For example, no two power registry callback functions can share the same callback
ID; on the other hand, your application’s power registry callback can use the same
ID as your application’s login screen callback. Thus, if your application only
registers one callback function with each of the various registries, all of your
callback functions can use your application symbol (with developer signature) as
their callback ID.
To generate unique identiers for multiple callbacks within the same registry, you
can prex an additional identier to your application symbol. For example, the
symbol
'|myFn1:MyApp:MySig| could be used to identify one of several
callback functions registered by the
MyApp:MySig application.
Unregistering Your Application for Change Notication 11
When your application no longer needs to be notied of changes to a particular
soup, it needs to call the
UnRegSoupChange function to unregister its callback
function for that soup.
// unregister my app’s Names soup callback
UnRegSoupChange(ROM_CardFileSoupName, '|myFn1:MyApp:MySig|);
Normally, you can unregister your soup change callbacks in the viewQuitScript
method of your application’s base view.
Responding to Notications 11
When a soup changes in some way, the system executes the callback functions
registered for that soup. Note that the system does not consider the soup to have
changed until an entry is written to the soup. Thus, changing a cached entry is not
considered a change to the soup until the
EntryChangeXmit function writes the
cached entry back to the soup.
Note
The system-supplied Preferences application sends
soup change notications only if your application
uses the
RegUserConfigChange function to register
for such notications.
Page view 496
1 2 ... 492 493 494 495 496 497 498 499 500 501 502 ... 941 942

Comments to this Manuals

No comments