[mcclim-devel] Confused by with-room-for-graphics

Timothy Moore moore at bricoworks.com
Thu Jan 27 09:53:20 UTC 2005


In the course of fixing a replay problem in with-room-for-graphics I 
took it upon myself to rewrite it to be consistent with the spec and 
the Franz manual, but now I'm thoroughly confused, especially by the 
menu drawing example. I had believed that the origin of the local 
coordinate system would be placed at the current cursor, possibly 
offset vertically by the height (if supplied) or by the maximum y value 
in the first quadrant case, even if this would result in some output 
with negative x coordinates being lost of the left edge of the screen. 
But  that means that the menu example in the Franz manual would lose 
the North and West points of the compass, which can't be right.

Can people with classic CLIM try this function in a listener (I believe 
classic CLIM has such a thing) and try (draw-compass *standard-output* 
'symbol t) and
(draw-compass *standard-output* nil)? I would like to know if  the 
entire compass is visible and if it overlaps other graphics in the 
output stream.

(defun draw-compass (stream &optional (type 'symbol) (quadrant nil))
   (labels ((draw-compass-point (stream type symbol x y)
              (clim:with-output-as-presentation (stream symbol type)
                (clim:draw-text* stream (symbol-name symbol) x y
                                 :align-x :center :align-y :center
                                 :text-style '(:sans-serif :roman 
:large)))))
     (clim:with-room-for-graphics (stream :first-quadrant quadrant)
       (clim:draw-line* stream 0 25 0 -25 :line-thickness 2)
       (clim:draw-line* stream 25 0 -25 0 :line-thickness 2)
       (dolist (point '((n 0 -30) (s 0 30) (e 30 0) (w -30 0)))
         (apply #'draw-compass-point stream type point)))))

Thanks a lot,
Tim




More information about the mcclim-devel mailing list