Next Previous Up Top Contents Index

8 DUIM-Gadgets Library

8.3 Gadget protocols

Gadgets are objects that make up an interface: the menus, buttons, sliders, check lists, tool bars, menu bars, and so on. Gadget classes may support three protocols, value, items, and activate.

Gadgets have a set of slots, or properties, associated with them: gadget-label, gadget-value, gadget-items, and gadget-enabled? Every gadget has some or all of these properties.

gadget-label

This slot holds the label that appears on the gadget on the screen. If a gadget does not have a label, the gadget-label function returns #f.

gadget-value

This slot holds the value(s) of the gadget. If a gadget does not have any values, the gadget-value function returns #f.

gadget-items

This slot is a list of the contents of the gadget. If the gadget does not have items, for example a button, gadget-items returns nothing.

gadget-enabled?

This slot tests whether or not the gadget is active. All gadgets have a gadget-enabled? slot.

An introduction to the protocols supported by different sorts of gadget can also be found in the Building Applications Using DUIM book.


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index