Top-level windows
Factor handbook > UI framework > Building user interfaces

Prev:Pre-made UI gadgets
Next:Status bars and mouse-over help


Opening a top-level window:
open-window ( gadget title/attributes -- )


Finding top-level windows:
find-window ( quot: ( world -- ? ) -- world/f )


Top-level windows are stored in a global variable:
worlds


When a gadget is displayed in a top-level window, or added to a parent which is already showing in a top-level window, a generic word is called allowing the gadget to perform initialization tasks:
graft* ( gadget -- )


When the gadget is removed from a parent shown in a top-level window, or when the top-level window is closed, a corresponding generic word is called to clean up:
ungraft* ( gadget -- )


The root of the gadget hierarchy in a window is a special gadget which is rarely operated on directly, but it is helpful to know it exists:
world


There is also syntax for defining window words, including a main window that is the entry point for a vocabulary:
WINDOW:

MAIN-WINDOW: