Adding List Items to Popup/Option Menus, etc.,

Michael Mandaville transcom at
Thu Mar 30 13:41:58 EST 2006

I am trying to take a items from a list to automatically populate PopUpMenus
and Option Menus when the List is updated.

The List uses a Priority Group - tPrimary.  An Option Menu - tSecondary.   A
field - tTask.   It puts these items into a field "List"

Here's the code for the button which puts these items into the field "List"

ON mouseUp
    put the hilitedButtonName of group "CheckBoxGroup" into tPrimary
    put the selectedText of button "Secondary" into tSecondary
    put field "Task" into tTask
    put tPrimary & tab & tSecondary & tab & tTask & cr after field "List"
END mouseUp

The above works fine.  Now I want to take the above items and put them into
a PopUpMenu (assuming that the same code also works for other menus, e.g.,
OptionMenu, etc., )


€The PopMenu would be on the same card as the list so I believe that this is
a local variable.
€Other PopMenus will be within the stack or on substacks so I believe that
this would require a global variable.   It sounds like it's better to use
globalvariables in the solution to have the info accessible from other
stacks and cards. 
€I would like to have the option of sorting the populated PopUpMenu by the
tPrimary variable.  All items set to "A" would be shown.

Thanks for all your help.  I've cut and pasted a half-dozen scripts and
tried my usual gum and bailing wire syntax.


More information about the Use-livecode mailing list