show-glass ( owner child visible-rect -- )
Factor handbook » UI framework » Building user interfaces » Gadget hierarchy and layouts » Glass layers

Next:hide-glass ( child -- )


ownera gadget
childa gadget
visible-recta rect


Word description
Displays child in the glass layer of the window containing owner.

The child's position is calculated with a heuristic:
The child must fit inside the window
The child must not obscure visible-rect, which is a rectangle whose origin is relative to owner
The child must otherwise be as close as possible to the edges of visible-rect

For example, when displaying a menu, visible-rect is a single point at the mouse location, and when displaying a completion popup, visible-rect contains the bounds of the text element being completed.