[mcclim-devel] compose-space question

Robert P. Goldman rpgoldman at sift.info
Thu May 19 21:57:02 UTC 2005


I have been finding that my application-panes look to be off in width
by the width of their scroll-bars.  When I look at the COMPOSE-SPACE
definitions (these are a little overwhelming for a novice like me) it
looks like the effective method for compose-space for an
application-pane is this one:

(defmethod compose-space ((pane clim-stream-pane) &key width height)
  (let ((w (bounding-rectangle-width (stream-output-history pane)))
        (h (bounding-rectangle-height (stream-output-history pane))))
    (make-space-requirement :width  w :min-width  w :max-width +fill+
                            :height h :min-height h :max-height
                            +fill+)))

This one doesn't have the potential for adding the width of
scrollbars.  Does this look like the right fix?


(defmethod compose-space :around ((pane clim-stream-pane) &key width height)
  (let ((inner-width (call-next-method)))
    (with-slots (scroll-bars) pane
      (cond ((null scroll-bars) inner-width)
	    ((eq scroll-bars :vertical)
	     (space-requirement+ inner-width
				 (compose-space (slot-value (pane-scroller pane) 'vscrollbar))))
	    ((eq scroll-bars :horizontal)
	     (space-requirement+ inner-width
				 (compose-space (slot-value (pane-scroller pane) 'hscrollbar))))
	    (t (space-requirement+
		inner-width
		(space-requirement+
		 (compose-space (slot-value (pane-scroller pane) 'vscrollbar))
		 (compose-space (slot-value (pane-scroller pane) 'hscrollbar)))))))))



More information about the mcclim-devel mailing list