CLIM mail archive

[Prev][Next][Index][Thread]

Protocol for Sizing inside Radio-box



   Date:     Thu, 7 Jul 94 10:13:58 EDT
   From: Nichael Cramer <ncramer@BBN.COM>

   [CLIM2/ALLEGRO/SPARC]

   I have my own home-built toggle-button gadgets and they work fine in most
   cases (i.e. drawn by hand via WITH-OUTPUT-AS-GADGET or incorporated into a
   frame, etc.). 

   I would like to use them in other "standard" ways, e.g. inside a RADIO-BOX.
   However by doing the straightforward thing (as described in the CLIM manual)
   it seems that my gadgets never receive the appropriate RESIZE/POSITION
   message(s).  Specifically, they are drawn at some small size (about 15X15
   pixels).   Furthermore, they don't receive a refresh/repaint message if the
   parent frame is de-exposed/re-exposed.

   Presumably I'm not handling some methods that I need.  Furthermore none of
   the "standard" things seem to be happening (for example COMPOSE-SPACE
   doesn't seem to get called at all on these gadgets when used in a RADIO-BOX).

   The class stucture under my gadget is:

   (defclass my-toggle-button-pane
       (labelled-gadget-mixin
	value-gadget
	silica::leaf-pane
	silica:space-requirement-mixin)
     ...)

   I've spent a couple of hours grovelling over the class structure for the
   normal TOGGLE-BUTTONS to no avail.  (Likewise, simply mixing in
   clim::TOGGLE-BUTTON or any of the other obvious classes don't seem to
   help.)

   Does anyone have any suggestions/hints/etc for the protocol here?

At the very least, you don't have all of the necessary classes mixed
in here.  I don't think there's good documentation for this.

Here is the skeleton for CLIM's home-grown toggle buttons:

;; COMPOSE-SPACE, ALLOCATE-SPACE, and HANDLE-REPAINT methods are
;; here because this is the class that implements the visual appearance
;; for a toggle button.
(defclass toggle-button-pane (toggle-button button-pane-mixin) (...))

;; The HANDLE-EVENT methods are here, because this mixin implements
;; the behavior of buttons in general, but not the appearance.
(defclass button-pane-mixin 
	  (space-requirement-mixin
	   leaf-pane)
    ;; ARMED has three states:
    ;;  NIL ==> the button is not armed
    ;;  T   ==> the button is armed, waiting for a pointer button press
    ;;  :ACTIVE ==> the button is armed, waiting for a pointer button release
    ((armed :initform nil))
  (:default-initargs :pointer-cursor :button))

;; This is the abstract class for push-buttons.  It inherits from
;; the other crucial gadget classes.
(defclass push-button 
	  (action-gadget labelled-gadget-mixin) 
    ((show-as-default :initform nil :initarg :show-as-default
		      :accessor push-button-show-as-default)
     (pattern :initarg :pattern)
     (icon-pattern :initarg :icon-pattern)))


Main Index | Thread Index