Page 322 Table of Contents Index Page 324
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
 
       (armed-callback pane (gadget-client pane) (gadget-id pane))
       (with-sheet-medium (medium pane)
         (highlight-button pane medium)))))

 ;; When the user releases the button and the button is still armed,
 ;; call the activate callback.
 (defmethod handle-event ((pane push-button-pane) (event pointer-button-release-event))
   (with-slots (armed) pane
     (when (eql armed ':button-press)
       (activate-callback pane (gadget-client pane) (gadget-id pane))
       (setf armed t)
       (with-sheet-medium (medium pane)
         (highlight-button pane medium)))))

30.3 Basic Gadget Classes

The following are the basic gadget classes upon which all abstract gadgets are built.

=> gadget [Protocol Class]
The protocol class that corresponds to a gadget, a subclass of pane. If you want to create a new
class that behaves like a gadget, it should be a subclass of gadget. Subclasses of gadget must
obey the gadget protocol.

All of the subclasses of gadget are mutable.

=> gadgetp object [Function]
Returns true if object is a gadget, otherwise returns false.

=> standard-gadget [Class]
The standard class on which all CLIM gadgets are built.

=> :id [Init Arg]
=> :client [Init Arg]
=> :armed-callback [Init Arg]
=> :disarmed-callback [Init Arg]
All subclasses of gadget must handle these four initargs, which are used to specify, respectively,
the gadget id, client, armed callback, and disarmed callback of the gadget.

=> gadget-id gadget [Generic Function]
=> (setf gadget-id) id gadget [Generic Function]
Returns (or sets) the gadget id of the gadget gadget. The id is typically a simple Lisp object
that uniquely identifies the gadgets.


Page 322 Table of Contents Index Page 324
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