preferences:add-callback in Framework Functions
(preferences:add-callback-> (-> void?)pfweak?)
p: symbol?
f: (symbol? any/c . -> . any/c)
weak?=#f: boolean?This function adds a callback which is called with a symbol naming a preference and it's value, when the preference changes.
preferences:add-callbackreturns a thunk, which when invoked, removes the callback from this preference.If
weak?is true, the preferences system will only hold on to the callback weakly.The callbacks will be called in the order in which they were added.
If you are adding a callback for a preference that requires marshalling and unmarshalling, you must set the marshalling and unmarshalling functions by calling
preferences:set-un/marshallbefore adding a callback.This function raises
exn:unknown-preferenceif the preference has not been set.