CLIM mail archive


Question about menu-choose-command...

    Date: Mon, 9 Sep 1991 15:25 EDT
    From: Michael Montag <>

    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))

      :associated-window *root*)

    should pop up a menu with 'item1' and 'item2' in it.
    Then depending on my choice the last form should return (not execute!) the
    corresponding command.

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.

    Another problem:

    Why does

    (clim:menu-choose '(item1 item2 item3) :label "Your Choice:"
		      :associated-window *root*)

    ignore the :label option. It is also ignored in the
    clim:accepting-values function.

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?

    Michael Montag


Main Index | Thread Index