CLIM mail archive

[Prev][Next][Index][Thread]

More Pull-Down Questions



    Date: Tue, 23 Nov 1993 10:34 EST
    From:     Nichael Cramer <ncramer@BBN.COM>

    [CLIM-2/Allegro/Sparc]

    Continuing my pursuit of the perfect motif-ish cascading/pull-down menu, a
    couple more questions more questions:

    1] I need to determine dynamically whether an item is enabled.  What I'm
    currently doing is using COMMAND-ENABLED method (dispatching on the
    COMMAND-NAME).   (Does this seem reasonable?)

Yes, this is exactly what COMMAND-ENABLED is for.

    This works reasonably well, except for those items which
    are themselves (recursive) sub-menu.  So far as I can determine there's no
    way to disable an item of this type.  Even using 
	(SETF (COMMAND-ENABLED ...) NIL)
    doesn't help.

I just implemented a (SETF (COMMAND-MENU-ENABLED ...) ...) frob to
address exactly this hole, just to see if it solves this problem.  I
believe that it does, so I guess I'll have to explain what I did to the
other CLIM hackers.

    Any suggestions?

    2] By the same token, is there any way for any item to be _both_ a
    command-item and a sub-menu-item?  I.e. such that moving over the "|>" icon
    causes the sub-menu to be invoked, but releasing over the item itself
    causes a regular command to be invoked?

No.  It can be either a command or a sub-menu, but not both.  I don't
think that supporting this polymorphism would be easy, either.  The data
structures used to do this don't appear to have enough flexibility to be
hammered in this direction.

    Thanks
    Nichael

    P.S.  I found my own answer to one of my questions from yesterday.  In
    short to get a motif-like scroll bar without using the default from
    (:MENU-BAR T) I can use a (CLIM:MAKE-PANE 'CLIM:MENU-BAR  ...) form in the
    frame definition.

    This works fine, except that it draws some items in a weird way.
    Specifically, if you give the pane background and foreground inks it draws
    items which have full-blown pull-down-menus under them just fine.  However
    items in the menu-bar that are simply commands get drawn in the regular
    "default" back/foreground colors.
 
    But I suspect this this is simply a genuine bug.  --N

If you could, could you send me a little test frame that does this?  I
dunno if Genera's home-grown menu bars will do the right thing, and it
would be nice to fix any bugs that might be there.



Main Index | Thread Index