Cascading Option Menus

dunbarx at dunbarx at
Wed Feb 2 13:15:07 EST 2011


There should be no issue here.

In a cascade menu put:


You will want to get the menuHistory in order to distinguish between the redundant choices:

on menuPick pItemName
 put pItemname && the menuhistory of me
end menuPick

I got this from 
Jan Shenkel wrote a nice description of "menu tags", which I append here:

Well, rev 3.5 introduced something called menu 'tagging' - here's a copy from the IDE change log included with rev 3.5


--Menu-item tagging

--The menu item specification has been extended to allow a tag to be specified. It is now of the form:
--  <label> [ '/' [ <accelerator> ] [ '|' <tag> ] ]
--Note that the <tag> is optional as is the <accelerator> however, if you want an item with a tag but without the accelerator you need:
--  <label> '/' '|' <tag>

--The <tag> must only be composed of characters from the ASCII character set.

--If a menu item has a <tag> then it is the tag string that is passed to menuPick rather than the <label>. This is useful for localization of menu items as you don't need to change the menuPick handler for each language supported.

--The following tags should be used to label the standard edit menu items to enable them to be controlled by the system dialogs on Mac OS X (e.g. answer file, ask file etc.):
--  undo, redo, cut, copy, paste, clear, select all, preferences

--Note: You should not mix the use of tags and no tags in Unicode menus. Doing so will cause empty values for all unicode items without tags.


--Even though it sounds like it's only for "menubar" menus, tagging works for any type of menu. So you can use this knowledge to make the text:

--My Silly Name That I Reuse For Everything/|1
--My Subgroup/|2
--<tab>My Silly Name That I Reuse For Everything/|3
--My Silly Name That I Reuse For Everything/|4

--And then your menupick will automagically get the 'tag' value as the line number; of course with sub-menus, you get a pipe-delimited list of tags, with the entire hierarchy.

--So assuming that you change the text of your menu to the above style, your script could be something like:
--on menuPick pItemTag
--  set the itemDelimiter to "|"
--  put the last item of pItemTag into tLineNumber
--  ...
--end menuPick

--Menu tags also greatly simplify multilingual apps, as we can now just tag the items in our preferred language (or english, for consistency with the MacOSX presets) and work with the tag in our scripts.

--Jan Schenkel

-----Original Message-----
From: Peter Haworth <pete at>
To: How to use LiveCode <use-livecode at>
Sent: Wed, Feb 2, 2011 12:37 pm
Subject: Cascading Option Menus

The recent thread on mouseDoubleup and particularly Richard's thought on HIG 
have made me realise the UI choices I made weren't the best.  I'm now thinking 
of using a cascading option menu.

The menuPick dictionary entry says "If the menu item is part of a submenu, the 
menu item label is followed by a vertical bar (|) and the submenu's label."
but what I'm seeing is just the actual submenu choice with tabs at the front of 

I don't think I can make this work since I could have the same submenu item 
listed under more than one main menu item.  What am I missing?

This is all on a Mac.

Pete Haworth

use-livecode mailing list
use-livecode at
Please visit this url to subscribe, unsubscribe and manage your subscription 



More information about the Use-livecode mailing list