2 Arrow Toggle Snip
|(require mrlib/arrow-toggle-snip)||package: gui-lib|
Represents a toggle control, displayed as a right-facing arrow (off or “closed”) or a downward-facing arrow (on or “open”).
The size of the arrow is determined by the style (and font) applied to the snip. The arrow is drawn inscribed in a square resting on the baseline, but the snip reports its size (usually) as the same as a capital X; this means that the snip should look good next to text (in the same style) no matter whether base-aligned or top-aligned.
(new arrow-toggle-snip% [[callback callback]])
→ (is-a?/c arrow-toggle-snip%) callback : (-> boolean? any) = voidThe on-up and on-down callbacks are called when the snip is toggled.
(send an-arrow-toggle-snip get-toggle-state) → boolean?Get the control’s state.
(send an-arrow-toggle-snip set-toggle-state v) → void?
v : boolean?Sets the control’s state. If the new state is different from the previous state, the appropriate callback is called.