27 Preferences
procedure
(preferences:put-preferences/gui name-list val-list) → any name-list : (listof symbol?) val-list : (listof any/c)
waits for three consecutive failures before informing the user
gives the user the opportunity to “steal” the lockfile after the third failure, and
when lock failures occur, it remembers what its arguments were and if any preference save eventually succeeds, all of the past failures are also written at that point.
procedure
(preferences:get-preference/gui sym [ default]) → any/c sym : symbol?
default : (-> void?) = (λ () (error 'get-preference/gui "unknown pref ~s" sym))
procedure
(preferences:add-panel labels f) → void?
labels : (or/c string? (cons/c string? (listof string?)))
f :
(->i ([parent (is-a?/c area-container-window<%>)]) () [_ (parent) (let ([old-children (send parent get-children)]) (and/c (is-a?/c area-container-window<%>) (λ (child) (andmap eq? (append old-children (list child)) (send parent get-children)))))])
The labels determine where this preference panel is placed in the dialog. If the list is just one string, the preferences panel is placed at the top level of the dialog. If there are more strings, a hierarchy of nested panels is created and the new panel is added at the end. If multiple calls to preferences:add-preference-panel pass the same prefix of strings, those panels are placed in the same children.
procedure
procedure
procedure
procedure
procedure
proc : ((is-a?/c vertical-panel%) . -> . void?)
procedure
proc : ((is-a?/c vertical-panel%) . -> . void?)
procedure
proc : ((is-a?/c vertical-panel%) . -> . void?)
procedure
proc : ((is-a?/c vertical-panel%) . -> . void?)
procedure
procedure
procedure
procedure
(preferences:add-check parent pref-key label [ from-boolean to-boolean]) → void? parent : (is-a?/c area-container<%>) pref-key : symbol? label : string? from-boolean : (-> boolean? any/c) = values to-boolean : (-> any/c boolean?) = values
The to-boolean and from-boolean functions are used to convert from the preferences value to a booleans when checking/unchecking the radio-box% object. The defaults amount to treating the preference as a boolean such that checking the radio-box% sets the preference to #t and unchecking it sets the preference to #f.