22 Notify-boxes
(require framework/notify) | package: gui-lib |
|
superclass: object% |
Examples: | |||||||||||||||
|
constructor
(new notify:notify-box% [value value])
→ (is-a?/c notify:notify-box%) value : any/c Creates a notify-box initially containing value.Gets the value currently stored in the notify-box.Updates the value stored in the notify-box and notifies the listeners.Adds a callback to be invoked on the new value when the notify-box’s contents change.Removes a previously-added callback.
method
(send a-notify:notify-box remove-all-listeners) → void?
Removes all previously registered callbacks.Added in version 1.18 of package gui-lib.
procedure
(notify:notify-box/pref proc [ #:readonly? readonly?]) → (is-a?/c notify:notify-box%) proc : (case-> (-> any/c) (-> any/c void?)) readonly? : boolean? = #f
Useful for tying a notify-box to a preference or parameter. Of course, changes made directly to the underlying parameter or state are not reflected in the notify-box.
Examples: | ||||||||||||||||||||||||
|
Added in version 1.18 of package gui-lib.
syntax
(notify:define-notify name value-expr)
value-expr : (is-a?/c notify:notify-box%)
The value-expr argument must evaluate to a notify-box, not just the initial contents for a notify box.
Useful for aggregating many notify-boxes together into one “configuration” object.
Examples: | |||||||||||||||||||||||
|
Added in version 1.18 of package gui-lib.
procedure
(notify:menu-option/notify-box parent label notify-box) → (is-a?/c checkable-menu-item%) parent : (or/c (is-a?/c menu%) (is-a?/c popup-menu%)) label : label-string? notify-box : (is-a?/c notify:notify-box%)
Added in version 1.18 of package gui-lib.
procedure
(notify:check-box/notify-box parent label notify-box) → (is-a?/c check-box%)
parent :
(or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%)) label : label-string? notify-box : (is-a?/c notify:notify-box%)
Added in version 1.18 of package gui-lib.
procedure
(notify:choice/notify-box parent label choices notify-box) → (is-a?/c choice%)
parent :
(or/c (is-a?/c frame%) (is-a?/c dialog%) (is-a?/c panel%) (is-a?/c pane%)) label : label-string? choices : (listof label-string?) notify-box : (is-a?/c notify:notify-box%)
If the value of notify-box is not in choices, either initially or upon an update, an error is raised.
Added in version 1.18 of package gui-lib.
procedure
(notify:menu-group/notify-box parent labels notify-box) → (listof (is-a?/c checkable-menu-item%)) parent : (or/c (is-a?/c menu%) (is-a?/c popup-menu%)) labels : (listof label-string?) notify-box : (is-a?/c notify:notify-box%)
Added in version 1.18 of package gui-lib.