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...
I've attached the complete code for context in case it's helpful.
-Duncan
----- 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
| | 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.
Seems like COM-DESCRIBE is in McCLIM but not Lispworks CLIM. I defined that, and worked around the CLIMI internal stuff using CLIM MAP-OVER-x functions. Having done that and a bit more hacking (below) your code worked, meaning that command "Show Sheet Hierarchy" displayed a tree of sheet objects that were mouse sensitive for COM-DESCRIBE.
Some other things:
(find-pane-named *application-frame* 'app) returned a SPACING-PANE. I had to use GET-FRAME-PANE instead.
Sometimes SHEET-CHILDREN popped a NO-APPLICABLE-METHOD for objects for which SHEETP returned T. The only way I could find to proceed was to define dummy methods for classes WIN32-LIB-CLIM::WIN32- TOP-LEVEL-MENU WIN32-LIB-CLIM::WIN32-SCROLLBAR-PANE WIN32-LIB-CLIM:: WIN32-POINTER-DOCUMENTATION-PANE
Obviously these won't be a problem in McCLIM but it does indicate probing too low into the implementation might be problematic.
Paul
On Saturday, April 30, 2005, at 03:48 PM, Paul Werkowski wrote:
| | 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.
Seems like COM-DESCRIBE is in McCLIM but not Lispworks CLIM.
Now you mention it the spec, from what I can remember, is very quiet about what commands are available in any given CLIM implementation. This probably means that for truly portable code, it's not possible to rely on any commands existing and all should therefore be defined in the application itself.
That seems like it could be quite a chore...
I defined that, and worked around the CLIMI internal stuff using CLIM MAP-OVER-x functions. Having done that and a bit more hacking (below) your code worked, meaning that command "Show Sheet Hierarchy" displayed a tree of sheet objects that were mouse sensitive for COM-DESCRIBE.
This is good news, I think. Or maybe not. Hrmmm.
Some other things:
(find-pane-named *application-frame* 'app) returned a SPACING-PANE. I had to use GET-FRAME-PANE instead.
From the spec: " get-frame-pane frame pane-name [Generic function] Returns the named CLIM stream pane in the frame frame whose name is pane-name .
find-pane-named frame pane-name [Generic function] Returns the pane in the frame frame whose name is pane-name . This can return any type of pane, not just CLIM stream panes. "
I had assumed (presumably incorrectly for Lispworks CLIM, at least) that a pane defined as being :interactor or :application would be, well, an interactor or an application pane (which are stream panes). I hadn't realized this might not be portable, but have changed the code accordingly.
Sometimes SHEET-CHILDREN popped a NO-APPLICABLE-METHOD for objects for which SHEETP returned T. The only way I could find to proceed was to define dummy methods for classes WIN32-LIB-CLIM::WIN32- TOP-LEVEL-MENU WIN32-LIB-CLIM::WIN32-SCROLLBAR-PANE WIN32-LIB-CLIM:: WIN32-POINTER-DOCUMENTATION-PANE
Obviously these won't be a problem in McCLIM but it does indicate probing too low into the implementation might be problematic.
Ouch... I could check for the method existing on the object, but I suspect this is a specification violation on the part of Lispworks... the spec is very clear that "All sheet objects must implement or inherit methods for each of these generic functions" (section 7.2.1) immediately above the description of SHEET-CHILDREN.
This is all very interesting to me, thank you for taking the time to investigate it.
-Duncan
Paul
On Saturday, April 30, 2005, at 02:02 PM, Paul Werkowski wrote:
----- 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.
This might be a safer way of doing it but I know there's a com-describe in the global command table and I'd like to use it; however, if that's not portable it might be better if I didn't.
I'm thinking at the moment it might be necessary for the command table for glimpse (defaults to 'glimpse' I believe) to :inherit-from the global command table maybe. There's a note for 'define-presetation-translator' that the translator will only be applicable when the command table provided as an argument in the call is one of the command tables from which the application frame's command table inherits. I don't know if this is a restriction for 'define-presentation-to-command-translator' but I'm going to investigate this some more.
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.
When I originally wrote the code I was using LIST I think, and the setf's just got left in.
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".
I'll change the code to be more compliant, thanks for pointing that out.
Originally the code was only intended to illustrate that application frames all generated a 'raised pane' that contains a 'menu pane' even if the application itself didn't use the menus. I then realized I could expand it somewhat to show me what was going on in the Beagle back end (with mirror regions and transformations etc.) a bit more easily than poking with the Listener; so it's currently very much a work in progress.
-Duncan
Paul
--->8--- snipped for brevity --->8---
I'm thinking at the moment it might be necessary for the command table for glimpse (defaults to 'glimpse' I believe) to :inherit-from the global command table maybe. There's a note for 'define-presetation-translator' that the translator will only be applicable when the command table provided as an argument in the call is one of the command tables from which the application frame's command table inherits. I don't know if this is a restriction for 'define-presentation-to-command-translator' but I'm going to investigate this some more.
--->8--- snipped for brevity --->8---
The note mentioned above is in the Allegro CLIM UG btw, not in the spec. (and not in Lispworks UG either) so I don't know if its relevant.
-Duncan
hi, i just got the latest version of ucw from tla, May 1st, 2005.. the server is up and running fine. However, when i try to access the examples page, it gave me a function undefined message: debugger invoked on a UNDEFINED-FUNCTION in thread 5746: The function IT.BESE.UCW::PARSE-REQUEST is undefined.
anyone know what's going on?
Duncan Rose duncan@robotcat.demon.co.uk writes:
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
The problem seems related more to the presentations than the translators, but I can't isolate it.
Concerning your comment in the Glimpse code:
;;; ::FIXME:: if :graph is specified here, we have problems because the graph ;;; doesn't fit on the pane, but the scroll bar updates and pane ;;; resizing DON'T HAPPEN! At least when we output text, the pane is sized so ;;; it can be scrolled!
This is probably a known issue:
http://mcclim.cliki.net/Bug#table-formatting-scrolling
with workarounds:
http://common-lisp.net/pipermail/mcclim-devel/2004-December/003567.html http://common-lisp.net/pipermail/mcclim-devel/2004-December/003573.html
Paolo
"PA" == Paolo Amoroso amoroso@mclink.it writes:
PA> Duncan Rose duncan@robotcat.demon.co.uk writes: >> 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
PA> The problem seems related more to the presentations than the PA> translators, but I can't isolate it.
PA> Concerning your comment in the Glimpse code:
PA> ;;; ::FIXME:: if :graph is specified here, we have problems because the graph PA> ;;; doesn't fit on the pane, but the scroll bar updates and pane PA> ;;; resizing DON'T HAPPEN! At least when we output text, the pane is sized so PA> ;;; it can be scrolled!
PA> This is probably a known issue:
PA> http://mcclim.cliki.net/Bug#table-formatting-scrolling
I just yesterday had a long conversation on #lisp with Andy H about this, which was very helpful. At least for format-graph-from-roots, I needed to explicitly call
change-space-requirements
We couldn't determine (well, Andy couldn't, and my attempt was cursory) whether the spec required format-graph-from-roots to change its stream's space requirements or not.
Best, R
Yes, this fixes it. I might dig at this a little deeper some time, it doesn't feel quite right to have to manually update space requirements on a sheet that is a scroller viewport; but then, with the work around, it's no big deal.
Thanks to 'R' (rpgoldman) for pointing this out too.
-Duncan
On Saturday, April 30, 2005, at 03:17 PM, Paolo Amoroso wrote:
Duncan Rose duncan@robotcat.demon.co.uk writes:
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
The problem seems related more to the presentations than the translators, but I can't isolate it.
Concerning your comment in the Glimpse code:
;;; ::FIXME:: if :graph is specified here, we have problems because the graph ;;; doesn't fit on the pane, but the scroll bar updates and pane ;;; resizing DON'T HAPPEN! At least when we output text, the pane is sized so ;;; it can be scrolled!
This is probably a known issue:
http://mcclim.cliki.net/Bug#table-formatting-scrolling
with workarounds:
http://common-lisp.net/pipermail/mcclim-devel/2004-December/%3E 003567.html
http://common-lisp.net/pipermail/mcclim-devel/2004-December/%3E 003573.html
Paolo
Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log _______________________________________________ mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
Does this work if you give the translator a high priority, like 100? There might be some weirdness with the default translator in the global command table.
Tim On Apr 30, 2005, at 10:54 AM, Duncan Rose wrote:
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...
I've attached the complete code for context in case it's helpful.
-Duncan
<glimpse.lisp>_______________________________________________ mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
On Saturday, April 30, 2005, at 04:30 PM, Timothy Moore wrote:
Does this work if you give the translator a high priority, like 100? There might be some weirdness with the default translator in the global command table.
Unfortunately changing the priority seems to make no difference.
-Duncan
Tim On Apr 30, 2005, at 10:54 AM, Duncan Rose wrote:
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...
I've attached the complete code for context in case it's helpful.
-Duncan
<glimpse.lisp>_______________________________________________ mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel