Trying to run McCLIM on windows-10/LispWorks 64-bit. This issue regards define-presentation-to-command-translator. The marked lines below show the problem. Apparently the McCLIM code resulted in replacing the DEV-X argument I wanted with a DEVICE-EVENT object I did not want. I then had to use a non exported function from clim-internals to retrieve the missing value. The &rest arg I put in is NIL in both cases. I have not figured out how that happened.
(defun %set-a-cursor #+clim-2.0 (chart cursor dev-x dev-y pane &rest stuff) ;<<<< #+mcclim (chart cursor event dev-y pane &rest stuff) ;<<<< (let* (#+mcclim (dev-x (climi::device-event-x event)) (x (untransform-position (medium-transformation pane) dev-x dev-y))) (with-slots (lcursor rcursor) chart (let ((newx (ecase cursor (rcursor (max (x-cursor-position lcursor) (ceiling x))) (lcursor (min (x-cursor-position rcursor) (floor x)))))) ;; args to com-set-cursor (list (slot-value chart cursor) newx pane)))))
(define-presentation-to-command-translator xlate-set-rcursor (clim:blank-area com-set-cursor plotter :documentation "Set Right Cursor" :gesture :menu :tester ((object window) (declare (ignore object)) (typep window 'basic-chart-pane))) (x y window) (%set-a-cursor (chart-pane-chart window) 'rcursor x y window))
Hey Paul,
thank you for the report! After looking into this I've concluded that your example is incorrect.
From http://bauhh.dyndns.org:8000/clim-spec/23-7.html#_1233 (define-presentation-to-command-translator specification):
The other arguments to define-presentation-to-command-translator are the same as for define-presentation-translator.
[applies also to to arglist]
Then http://bauhh.dyndns.org:8000/clim-spec/23-7.html#_1230 (define-presentation-translator specification)
arglist, tester-arglist, and doc-arglist are each an argument list that must "match" the following "canonical" argument list. (object &key presentation context-type frame event window x y) In order to "match" the canonical argument list, there must be a single positional argument that corresponds to the presentation's object, and several named arguments that must match the canonical names above (using string-equal to do the comparison)
In your example you have:
(define-presentation-to-command-translator xlate-set-rcursor (clim:blank-area com-set-cursor foo) (x y window) (%set-a-cursor *standard-output* x y window))
So the arglist is (x y window). X is matched as the positional required argument OBJECT, then Y and WINDOW are matched by name (as if we had transformed this arglist to (object &key y window). Perhaps LW CLIM doesn't uphold this requirement and matches all arguments by name?
Best regards, Daniel
-- Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland TurtleWare - Daniel Kochmański | www.turtleware.eu
"Be the change that you wish to see in the world." - Mahatma Gandhi