UI pen protocol
Factor handbook » UI framework » Implementing new gadgets » Customizing gadget appearance

Next:Implementing custom drawing logic

The interior and boundary slots of a gadget facilitate easy factoring and sharing of drawing logic. Objects stored in these slots must implement the pen protocol:
draw-interior ( gadget pen -- )

draw-boundary ( gadget pen -- )

The default value of these slots is the f singleton, which implements the above protocol by doing nothing.

Some other pre-defined implementations:
Gradient pens
Image pens
Polygon pens
Solid pens
Tile pens

Custom implementations must follow the guidelines set forth in Implementing custom drawing logic.