diff --git a/devel/scheme/gui/scheme-gui-intro.en.tm b/devel/scheme/gui/scheme-gui-intro.en.tm index ed862f1..6c5655a 100644 --- a/devel/scheme/gui/scheme-gui-intro.en.tm +++ b/devel/scheme/gui/scheme-gui-intro.en.tm @@ -72,7 +72,7 @@ done with the keyword, as in , but in order to have both widgets sit side by side, you'll need a container widget as described in "", such as : + co.|scheme-gui-advanced.en.tm>", such as : <\session|scheme|default> <\unfolded-io|Scheme] > @@ -118,7 +118,7 @@ The special symbol \\> is just one of the predefined glue widgets described in "". + co.|scheme-gui-advanced.en.tm>". team.> diff --git a/devel/scheme/utils/utils-preferences.en.tm b/devel/scheme/utils/utils-preferences.en.tm index e0554b6..33e24ec 100644 --- a/devel/scheme/utils/utils-preferences.en.tm +++ b/devel/scheme/utils/utils-preferences.en.tm @@ -1,13 +1,91 @@ - + <\body> + Preferences are used to store any information you need to keep across + different runs of , like window position and size, active menu + bars, etc. Internally they are stored in the users home directory as a + list of items like which therefore has in + principle no structure. However, a good practice to avoid conflicts is to + prefix your options by the name of the plugin or module you are creating, + like in . + + The first step in defining a new preference is adding it with + and assigning a call-back function to handle + changes in the preference. This is important for instance in menus, where a + click on an item simply sets some preference to some value and it's up to + the call-back to actually take the necessary actions. + \; - + <\explain> + )> + <|explain> + Each element of is of the form where is a procedure taking two + arguments like this: + + + + <\folded-documentation> + Example + <|folded-documentation> + <\session|scheme|default> + <\input|Scheme] > + (define (notify-test pref value) + + \ \ (display* "Hey! " pref " changed to " value)(newline)) + + + <\input|Scheme] > + (define-preferences ("test:pref" #f notify-test)) + + + <\unfolded-io|Scheme] > + (get-preference "test:pref") + <|unfolded-io> + #f + + + <\input|Scheme] > + (set-preference "test:pref" #t) + + + <\input|Scheme] > + \; + + + + + + <\explain> + )> + <|explain> + Save preference with value . Then call the + call-back associated to this preference, as defined in + . + + + <\explain> + )> + <|explain> + Deletes preference from the user preferences. + + + <\explain> + )> + <|explain> + Returns the value of preference . + + +