checking/unchecking menus after a menu with cascading menus

FlexibleLearning at FlexibleLearning at
Sun Aug 15 06:27:06 EDT 2004

> now that we are on the same page ... this is my problem. i CAN with  SCRIPT
> to put a check mark in a menus and take them out but i can NOT  put a
> checkmark in a cascade menu ... AND i can NOT get the checkmarks  to appear
> in the correct menu when there is more than one drop down menu  with one of
> the menus having a cascade menu ... the checkmarks appear  but on the wrong
> menuItems

1. Use a Cascade button-style for  menu stacks you build yourself.
2. For a simple hierarchical menu, use tab  indents in the text of the button 
to implement sub-menus.
3. To place a  checkmark next to a menuItem or hierarchical menuItem, put !c 
at the _start_ of  the line...

!c      P1
!c            P2.2

Note that checkmarks will  fail to display if you try to use them for 
menuItems that have sub-menus (ie.  'parents' cannot show that their 'children' are 
checkmarked). Checkmarks also  fail to display if you place the checkmark 
anywhere other than at the beginning  of the line (syntax rules). Note also that as 
soon as a menuItem or sub-menuItem  has any checkmark identifier (!c or !n or 
!r or !u), all menuItems at all levels  will display offset to the right.

To script the example above, you could  use the format notation of \n to 
indicate a new line and \t to indicate a  tab...

"Apples\n\tA1\n\tA2\n\tA3\nPears\n!c\tP1\n\tP2\n\t\tP2.1\n!c\t\tP2.2\n\tP3" into  tStr
set the text of btn "MyHierMenu" to format(tStr)

To dynamically  build menus, place the script in a mouseDown handler. For 
example, in a button  try this...

on mouseDown
"Apples\n\tA1\n\tA2\n\tA3\nPears\n!c\tP1\n\tP2\n\t\tP2.1\n!c\t\tP2.2\n\tP3" into  tStr
set the text of me to format(tStr)
end mouseDown

Final point: If the menus are dynamically built in a menubar group,  place 
the menu-building script in the background script of the group as the  button 
itself will not receive the mouseDown message.

Hope this helps you. Your frustration is evident in the tone of your  message.


More information about the Use-livecode mailing list