Robert Goldman wrote:
A quick follow-up: this problem only occurs when I invoke my command from the menu-bar (i.e., from a submenu in the "File" menu on the menubar). When I invoke the command by using the menu I get with the right-button on the application window, McCLIM prompts for commands properly.
So have I misunderstood how to use the menu bar? Or is this a bug?
Many thanks, Robert _______________________________________________ mcclim-devel mailing list mcclim-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel
OK, I think that this is a real bug. The problem is that when you select a command from a menu item, if it's a command that takes arguments, and you haven't provided values for them, McCLIM reads the command as (<command-name>) and pukes on the missing argument(s).
The problem is that it *should* be reading such a command as:
(<command-name> <unsupplied-argument-marker>^n)
for n being the number of arguments to the command.
I have a patch that will make this happen properly:
Index: frames.lisp =================================================================== RCS file: /project/mcclim/cvsroot/mcclim/frames.lisp,v retrieving revision 1.125 diff -b -u -F^(def -r1.125 frames.lisp --- frames.lisp 7 Feb 2007 12:44:16 -0000 1.125 +++ frames.lisp 2 Mar 2007 21:52:13 -0000 @@ -505,9 +505,9 @@ (defmethod read-frame-command :around (( (menu-item (let ((command (command-menu-item-value object))) (unless (listp command) - (setq command (list command))) + (setq command (partial-command-from-name command))) (if (and (typep stream 'interactor-pane) - (member *unsupplied-argument-marker* command :test #'eq)) + (partial-command-p command)) (command-line-read-remaining-arguments-for-partial-command (frame-command-table frame) stream command 0) command)))))
I will also attach it for fear mailers that word-wrap will garble it...
Any feedback would be welcome. This works for me, but isn't even what I'd laughingly call "tested."
R
Index: frames.lisp =================================================================== RCS file: /project/mcclim/cvsroot/mcclim/frames.lisp,v retrieving revision 1.125 diff -b -u -F^(def -r1.125 frames.lisp --- frames.lisp 7 Feb 2007 12:44:16 -0000 1.125 +++ frames.lisp 2 Mar 2007 21:56:05 -0000 @@ -505,9 +505,9 @@ (defmethod read-frame-command :around (( (menu-item (let ((command (command-menu-item-value object))) (unless (listp command) - (setq command (list command))) + (setq command (partial-command-from-name command))) (if (and (typep stream 'interactor-pane) - (member *unsupplied-argument-marker* command :test #'eq)) + (partial-command-p command)) (command-line-read-remaining-arguments-for-partial-command (frame-command-table frame) stream command 0) command)))))