Page 318 Table of Contents Index Page 320
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E





Chapter 30

Gadgets

30.1 Overview of Gadgets

Gadgets are panes that implement such common toolkit components as push buttons or scroll
bars. Each gadget class has a set of associated generic functions that serve the same role that
callbacks serve in traditional toolkits. For example, a push button has an "activate" callback
function that is invoked when its button is "pressed"; a scroll bar has a "value changed" callback
that is invoked after its indicator has been moved.

The gadget definitions specified by CLIM are abstract, that is, the gadget definition does not
specify the exact user interface of the gadget, but only specifies the semantics that the gadget
should provide. For instance, it is not defined whether the user clicks on a push button with
the mouse or moves the mouse over the button and then presses some key on the keyboard to
invoke the "activate" callback. Each toolkit implementations will specify the "look and feel" of
their gadgets. Typically, the look and feel will be derived directly from the underlying toolkit.

Each of CLIM's abstract gadgets has at least one standard implementation that is written using
the facilities provided solely by CLIM itself. The gadgets' appearances are achieved via calls
to the CLIM graphics functions, and their interactive behavior is defined in terms of the CLIM
input event processing mechanism. Since these gadget implementations are written entirely in
terms of CLIM, they are portable across all supported CLIM host window systems. Furthermore,
since the specific look and feel of each such gadget is "fixed" in CLIM Lisp code, the gadget
implementation will look and behave the same in all environments.

30.2 Abstract Gadgets

The push button and slider gadgets alluded to above are abstract gadgets. The callback interface
to all of the various implementations of the gadget is defined by the abstract class. In the :panes
clause of define-application-frame, the abbreviation for a gadget is the name of the abstract


Page 318 Table of Contents Index Page 320
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E