Registering Soup Change Notifications in NewtApp

One of the Newton 2.x OS Q&As
Copyright © 1997 Newton, Inc. All Rights Reserved. Newton, Newton Technology, Newton Works, the Newton, Inc. logo, the Newton Technology logo, the Light Bulb logo and MessagePad are trademarks of Newton, Inc. and may be registered in the U.S.A. and other countries. Windows is a registered trademark of Microsoft Corp. All other trademarks and company names are the intellectual property of their respective owners.


For the most recent version of the Q&As on the World Wide Web, check the URL: http://www.newton-inc.com/dev/techinfo/qa/qa.htm
If you've copied this file locally, click here to go to the main Newton Q&A page.
This document was exported on 7/23/97.


NEW: Registering Soup Change Notifications in NewtApp (5/15/97)

Q: I have an application based on the NewtApp framework. When I register to receive soup change notifications, things start to behave strangely. What's going wrong?

A: This problem is caused because of a naming conflict. When your application is opened, the NewtApp framework registers to receive soup change notifications using your application's symbol as the callbackID parameter to the RegSoupChange global function. If you also use your application's symbol as the callbackID parameter, you will overwrite the NewtApp framework's registration. There are two ways to work around this problem.

1) Use a different callbackID symbol in your call to RegSoupChange.
2) Use the NewtApp framework's registration callback method. When your soup has changed, the NewtApplication's NewtSoupChangedNotify method is called. It is passed the same four parameters as the callback function parameter of RegSoupChange.

If you do override the NewtSoupChangedNotify method, be sure to call the inherited method.

Here is an example:

    application:NewtSoupChangedNotify(theName, appSym, changeType, changeData)
begin
    // Do your stuff here
    
    inherited:?NewtSoupChangedNotify( theName, appSym, changeType, changeData );
end;