2 Arrow Toggle Snip

▼ |  | Mr Lib: Extra GUI Libraries

1 | Aligned Pasteboard
2 | Arrow Toggle Snip
3 | Bitmap Label
4 | Cache-image Snip
5 | Close Icon
6 | Expandable Snip
7 | GIF and Animated GIF Writing
8 | Graphs
9 | Hierarchical List Control
10 | Include Bitmap
11 | Interactive Value Port
12 | Name Message
13 | Path Dialog
14 | Plot
15 | Switchable Button
16 | Image Core
17 | Matrix Snip
18 | Snip Canvases
19 | Syntax Browser
20 | Te X Table
21 | Terminal Window
22 | White on Black Panel Predicate
23 | Acknowledgments
| Index

On this page:

arrow-toggle-snip%
new
get-toggle-state
set-toggle-state

top contents ← prev up next →

## 2 Arrow Toggle Snip🔗ℹ

(require mrlib/arrow-toggle-snip) | package: gui-lib

class arrow-toggle-snip% : class?
superclass: snip%

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.

> > constructor (new arrow-toggle-snip% [[callback callback]])
> > → (is-a?/c arrow-toggle-snip%)
> > callback : (-> boolean? any) = void

> The on-up and on-down callbacks are called when the snip is toggled.

> > method (send an-arrow-toggle-snip get-toggle-state) → boolean?

> Get the control’s state.

> > method (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.

top contents ← prev up next →