CLIM mail archive


RE: tracking-pointer :transformp has no effect

>>>>> Scott McKay <SWM@STONY-BROOK.SCRC.Symbolics.COM> writes:

 I had asked:

   In CLIM 1.0 & Genera 8.1 does the :transformp option to
   tracking-mouse work?  The following code returns the same values
   for the pointer location, regardless of the :transformp option.

 Scott McKay replied:
   :TRANSFORMP is a predicate that says to transform the X,Y
   coordinates by the stream's current transformation.  You are using
   it incorrectly.

 For the net: Wrapping a with-drawing-options around the code in
 question solved it as follows:

     (define-network-design-command (com-show-warped-mouse
 				   :name "Show Warped Mouse" :menu nil)
 	((frame *application-frame*)
 	 (window (get-frame-pane frame 'work-area))
 	 (tf (compose-transformations
 	       (make-scaling-transformation 2 3)
 		    (make-rotation-transformation .2)
 		    (make-translation-transformation 10 20)))))
    ;; with-drawing-option allows the :transformp option to
    ;; work in tracking-pointer
    (with-drawing-options (window :transformation tf)
 	(catch 'up
 	  (tracking-pointer (window :multiple-window nil)
 	  (:pointer-button-press (event x y)
 	   (format window "~%Untransformed Pointer 2: ~D,~D" x y)
 	    (throw 'up nil))))
 	(catch 'up
 	  (tracking-pointer (window :multiple-window nil :transformp t)
 	  (:pointer-button-press (event x y)
 	   (format window "~%Transformed   Pointer 2: ~D,~D" x y)
 	    (throw 'up nil)))))))

 thanks Scott,

Brent Neal Reeves          (303) 492-1218
		       "visualize whirled peas"

Main Index | Thread Index