checkmark on submenu items

Sarah Reichelt sarah.reichelt at gmail.com
Thu Apr 27 19:20:10 EDT 2006


On 4/28/06, kevin <trancepacific at gmail.com> wrote:
> Does anyone know how to mark submenu items with checkmarks? It seems
> that when I use the following code on an item that I know is part of a
> cascading menu, it takes that menu out of the submenu and puts it into
> the main menu:
>
> put "!cSubmenu Item" into menuItem 2 of button "File"
>
> I realize that the "!c" should be appended to the beginning of the item
> to yield the "check" but am stumped on how to implement this on a
> submenu. The Rev User Guide seems to indicate that this may not be
> possible but its not clear to me.

To make a sub-menu item, you need to start the line with a tab. The
"!c" can be added either before or after the tab.

Here is a script of the sort I use for constructing menus dynamically:

    put "Main" & cr into tMenu
    put tab & "Sub 1" & cr after tMenu
    put tab & "!cSub 2" & cr after tMenu
    put tab & "Sub 3" & cr after tMenu
    put tMenu into btn Menu"

And for an easy way to uncheck everything:

   replace "!c" with empty into btn "Menu"

HTH,
Sarah



More information about the use-livecode mailing list