Check and Uncheck a menuItem

Jeanne A. E. DeVoto jeanne at runrev.com
Thu May 16 14:47:00 EDT 2002


At 3:39 PM -0700 5/15/2002, Bill Vlahos wrote:
>How do I toggle a checked menuItem?

Put "!c" in front of the menu item to add a check; put "!n" in front of it
to remove it. For example:

  on menuPick myItem
    if char 1 to 2 of line (the menuHistory of me) of me is "!c"
    then delete char 1 to 2 of line (the menuHistory of me) of me
  end menuPick

>How can I check the status of a menuItem (for example is the item
>checked)?

See above - check the first two characters.

>I can't find this anywhere in the docs.

There's some discussion in "About menus and the menu bar" (scroll down to
the section "Special effects in menus"). The upcoming Cookbook (yes! At
last! The script cookbook is coming!) will have several recipes devoted to
manipulating menus, and checking/unchecking will be one of them.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list