----- Original Message ----- From: "Duncan Rose" duncan@robotcat.demon.co.uk To: mcclim-devel@common-lisp.net Sent: Saturday, April 30, 2005 4:54 AM Subject: [mcclim-devel] Command translator question
| | I'm trying to define a presentation command translator which will | invoke 'describe presentation' on specific types. Unfortunately it | doesn't work (or at least, works in a way that I'm not expecting so if | it's working it's not doing what I want ;-) | | Looking at the translators defined in the Listener and in | builtin-commands.lisp hasn't helped. Here's the translator: | | (define-presentation-to-command-translator port-select-to-command ; | name | (t ; from-type | com-describe ; command-name - maybe | com-describe-presentation? | global-command-table ; command table containing command | :gesture :select ; activate on :select (left-button click) | ;; :tester ... | :documentation | "Invoke the 'describe presentation' command on the selected | presentation" | :pointer-documentation ((object stream) (format stream "Describe ~A" | object)) | :menu t ; command should appear in popped-up menus | ;; :priority ... | :echo nil) ; don't echo the command when it is invoked | ;; arglist must be a subset (using string-equal) of: | ;; (object presentation context-type frame event window x y) | (object) | ;; body of translator; returns a list of the arguments to the command | ;; named by command-name. | (list object)) | | In case I was providing the wrong 'from-type' I changed it to T (all | types, I hope). I've written this using the Beagle back end but it | doesn't work for me when run under CLX either... | | Any suggestions would be appreciated, I'm obviously missing something...
Well, you have not defined COM-DESCRIBE in the attached glimpse.lisp. I have never tried using the global command table in translators so I can't say for sure that it should work. I have always used the frame command table for translators.
Just a nit, but I don't ever recall seeing the idiom (setf x (push thing x)) used elsewhere, just (push thing x) will do.
Another nit, you should avoid using unxported CLIMI features. MAP-OVER-PORTS instead of CLIMI::*ALL-PORTS* MAP-OVER-GRAFTS instead of CLIMI::PORT-GRAFTS would make it possible for me to try this code in a "classic CLIM".
Paul