CLIM mail archive
Question about menu-choose-command...
Date: Mon, 9 Sep 1991 15:25 EDT
From: Michael Montag <email@example.com>
Reading the manual for CLIM 1.0 I thought evaluating
(setq *root* (clim:open-root-window :clx))
(clim:define-command (item1 :menu t :command-table clim:user-command-table)
() (print 1))
(clim:define-command (item2 :menu t :command-table clim:user-command-table)
() (print 2))
should pop up a menu with 'item1' and 'item2' in it.
Then depending on my choice the last form should return (not execute!) the
This is odd. The documentation clearly states that it returns the
command object, but there is no question that when I wrote the code, I
intended to make it execute the chosen command. In fact, the "command
menu sub-menu" translator (for which this function was written) depends
on the current behavior. I'm afraid I will have to claim that the
documentation is wrong, and the current behavior is correct. To get the
behavior you want, it is pretty easy to collect all of the command
table's menu names and call MENU-CHOOSE.
What happens is:
The menu pops up, but the items are not mouse-sensitive. Clicking inside the
menu hasn't any effect. Clicking outside the menu returns NIL.
Are the items in the menu displayed in italic? I bet they are,
indicating that the are not applicable commands in the current context.
(clim:menu-choose '(item1 item2 item3) :label "Your Choice:"
ignore the :label option. It is also ignored in the
The code for the CLX port looks right to me, but I am not CLX expert.
Perhaps someone knowledgeable in CLX from Franz can answer.
My working environment is:
SUN Sparc 1+, Open Windows 2.0, Allegro CL 4.0.1, CLIM 1.0
Are that known problems or is something wrong with my thinking or program?
Main Index |