WINDOW:
Factor handbook » UI framework » Building user interfaces » Top-level windows

Prev:world
Next:MAIN-WINDOW:


Vocabulary
ui

Syntax
WINDOW: window-word { attributes } attribute-code ;


Word description
Defines a word for the current vocabulary named window-word that opens a UI window when run. The attributes specify the key-value pairs of the window's world-attributes. The attribute-code is run with the world-attributes on the stack; this allows the word to construct gadget objects to place in the gadget slot or set other runtime-dependent world attributes.

Examples
From the hello-ui vocabulary. Creates a window with the title "Hi" containing a label reading "Hello world":
USING: accessors ui ui.gadgets.labels ; IN: hello-ui WINDOW: hello { { title "Hi" } } "Hello world" <label> >>gadgets ;


See also
MAIN-WINDOW:

Definition