Each class of gadget has a set of associated slots that help define the properties for that class. Different classes of gadget have different sets of slots. This section describes some of the more important slots available. The following slots are common across most (though not necessarily all) gadget classes.
gadget-label This slot holds the label that is associated with a gadget.
gadget-label returns #f.
gadget-enabled? gadget-enabled? slot. The gadget-enabled? slot returns either #t or #f. When a gadget is disabled, it is usually grayed out on the screen, and cannot be interacted with in any way.
gadget-value This slot holds the value of the gadget. Most gadgets can have a value of some kind; these are general instances of the <value-gadget> class. However, gadgets such as borders that are placed around elements have no associated value.
gadget-value-type depends on the class of gadget involved. For a text field, the gadget value is the string typed into the text field. For a gadget with several items (see gadget-items below), such as a list, the gadget value is the selected item. For a radio button, the gadget value is a boolean that denotes whether the button is selected or not.
gadget-value returns #f.
All of the slots described above can also be specified as init-keyword values when creating an instance of a gadget. In all cases, the init-keyword name is the same as the slot name, but without the preceding gadget-. Thus, a gadget can be enabled or disabled when it is first created by specifying the enabled?: init-keyword appropriately.
Gadgets can also have a variety of associated callbacks. A callback is a function that is invoked when a particular event occurs that is associated with a given gadget, such as pressing a button. It is the primary technique you use to make your applications "do something". Like gadget properties, different classes of gadget can have different callback types available. For an introduction to callbacks, see Section 7.2.7 on page 113.