How to commit prefs before the user presses "Apply"?

Kevin Finn kevinfinn@mediaone.net
Tue, 1 Aug 2000 00:00:29 -0500


     I'm trying to set up a complex boolean option in the prefs, such that you
can include the definition of a function in an option definition and the
function will be called when the option is selected.  The immediate use for this
would be so that toggling a boolean option could immediately make another option
selectable or not selectable.  I have this all set up in the setter function,
so that the setter sets the value and also calls the specified function. 
Unfortunately, the setter doesn't seem to get called immediately when you
toggle the option - it only gets called when the user selects "Apply" or "OK". 
This doesn't work that well if you're expecting option 1's setter to "grey out"
option 2 - the constraint on the user of making a particular option
non-selectable doesn't take effect until the user clicks "Apply".

      Is there a way to force the setting of an option right away?  I suppose I
could add a flag to the generic options structure that would make it call the
setter right away, but I'm hesitant to make such a large change to the options
structure if there's an easier way.

     Any thoughts?

-- 

Kevin Finn
kevinfinn@mediaone.net