Apple Newton Utilities Betriebsanweisung Seite 496

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 942
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 495
CHAPTER 11
Data Storage and Retrieval
11-64 Using Newton Data Storage Objects
control how and when notications are sent
The rst part of this section describes how to register and unregister a callback
function for execution in response to changes in a particular soup. The next part
describes the various notications that may be sent. The last part of this section
describes how applications send soup change notications.
Registering Your Application for Change Notication 11
The RegSoupChange global function registers a callback function for execution
in response to changes in a particular soup. Note that this callback function must
not call either of the
RegSoupChange or UnRegSoupChange functions.
If your application needs to respond to changes in more than one soup, you’ll need
to call the
RegSoupChange function once on each soup for which your
application requires change notication. This approach is valid for any system-
supplied soup except that used by the built-in Preferences application. For
notication of changes to user preferences, you must call the
RegUserConfigChange function.
You can call the
RegSoupChange function at any time that makes sense for your
application. For example, you might do so from within your base view’s
viewSetupDoneScript method; however, this is only a suggested guideline. In
order to conserve available memory, your application should minimize the amount
of time callback functions remain registered.
The following code example shows how to register your application for notication
of changes to the soup used by the built-in Names application:
local myFn := func (soupName, appSym, changeType, changeData)
begin
if (changeType) then
begin
if (changeType <> 'whatThe) then
print (changeType && "in the" && soupName &&
"soup by the" && GetAppName(appSym) &&
"application.");
else
print ("Unspecified changes occurred in the" &&
soupName && "soup.");
end;
end;
// register for changes to soup used by built-in "Names" app
RegSoupChange(ROM_CardFileSoupName, '|myFn1:MyApp:MySig|, myFn);
Seitenansicht 495
1 2 ... 491 492 493 494 495 496 497 498 499 500 501 ... 941 942

Kommentare zu diesen Handbüchern

Keine Kommentare