Glass layers
Factor handbook > UI framework > Building user interfaces > Gadget hierarchy and layouts

Prev:Book layouts
Next:Manual layouts


The ui.gadgets.glass vocabulary implements support for displaying gadgets in the glass layer of a window. The gadget can be positioned arbitrarily within the glass layer, and while it is visible, mouse clicks outside of the glass layer are intercepted to hide the glass layer. Multiple glass layers can be active at a time; they behave as if stacked on top of each other.

This feature is used for completion popups and Popup menus in the UI developer tools.

Displaying a gadget in a glass layer:
show-glass ( owner child visible-rect -- )


Hiding a gadget in a glass layer:
hide-glass ( child -- )


Callback generic invoked on the gadget when its glass layer is hidden:
hide-glass-hook ( gadget -- )


Popup gadgets add support for forwarding keyboard gestures from an owner gadget to the glass layer:
show-popup ( owner popup visible-rect -- )

pass-to-popup ( gesture owner -- ? )