Implementing new gadgets
Factor handbook > UI framework

Prev:Building user interfaces
Next:Developing UI backends


One of the goals of the Factor UI is to minimize the need to implement new types of gadgets by offering a highly reusable, orthogonal set of building blocks. However, in some cases implementing a new type of gadget is necessary, for example when writing a graphical visualization.

Bare gadgets can be constructed directly, which is useful if all you need is a custom appearance with no further behavior (see UI pen protocol):
<gadget> ( -- gadget )


New gadgets are defined as subclasses of an existing gadget type, perhaps even gadget itself. Direct subclasses of gadget can be constructed using new, however some subclasses may define their own parameterized constructors (see Parameterized constructors).

Further topics:
UI gestures
Customizing gadget appearance
Implementing controls
Clipboard protocol
Gadget line support

See also
Implementing layout gadgets