Use of WINDOW_NewPrefsHook

3 posts / 0 new
Last post
OldFart
OldFart's picture
Offline
Last seen: 3 hours 56 min ago
Joined: 2010-11-30 14:09
Use of WINDOW_NewPrefsHook

Hi,

Well, now I'm dabbling a bit more with all those WINDOW_-tags, I came across this one again, which I've tried to put to use several times now without any luck.

I've applied the tag with a proper ti_Data-value, a Hook with a pointer to a proper function. That function does not do much more currently then print out some message on a console window when invoked. What ever I do, after changing some PREFS-file nothing is printed on the console.

What is a proper way to handle PREFS changes?

OldFart

salass00
salass00's picture
Offline
Last seen: 1 year 1 month ago
Joined: 2011-02-03 11:27
It's probably the

It's probably the window.class equivalent of IDCMP_NEWPREFS so you may have to set your window to wait for this class of IDCMP message as well using WA_IDCMP tag.

In any case judging from the RKRM documentation on IDCMP_NEWPREFS this method of notification was obsolete already in AmigaOS 2.0:

  1. IDCMP_NEWPREFS
  2. IDCMP_NEWPREFS messages are sent when the system Preferences are
  3. changed by a call to SetPrefs(). The program can learn of these
  4. changes by setting this flag.
  5.  
  6. After receiving a message of class IDCMP_NEWPREFS, the application
  7. should call GetPrefs() to obtain a copy of the new Preferences.
  8.  
  9. Under the new Preferences scheme used in Release 2 and later versions
  10. of the OS, an IDCMP_NEWPREFS message will not always be sent when the
  11. user changes a Preferences setting. Only Preferences values
  12. available under V34, i.e., those that can be modified by a call to
  13. SetPrefs(), will cause an IDCMP_NEWPREFS message to be sent. New
  14. Preferences items such as overscan or font settings rely on
  15. filesystem notification for monitoring changes. See the chapter on
  16. "Preferences" for more information.
  17.  
  18. This message type is broadcast to all IDCMP that have this flag set,
  19. not just to the active window. If the application has this flag set,
  20. it should be prepared to handle the event even if it is not active.
OldFart
OldFart's picture
Offline
Last seen: 3 hours 56 min ago
Joined: 2010-11-30 14:09
@salass00 Thanks for the

@salass00

Thanks for the explanation. I'll leave it for what it currently is, i.e. not reacting to prefs changes.

OldFart

Log in or register to post comments