Page 1 of 1

Option Menus

Posted: Wed Jun 19, 2013 12:14 am
by buchacho
I have an option menu that is populated with some values. How would I be able to clear all the lines of the option menu, when I am ready to repopulate the whole list of options?

Is there detailed documentation on how to use option menus?

Re: Option Menus

Posted: Wed Jun 19, 2013 12:39 am
by Dixie
To clear the menu items in the option menu

Code: Select all

 put empty into button "theNameOfThebutton"
then put your new list of things into it...

Code: Select all

put "Able,Baker,Charlie,Delta" into theNewList
repeat with count = 1 to the number of items of theNewList
   put item count of theNewList & cr after button "theNameOfThebutton"
end repeat

Re: Option Menus

Posted: Wed Jun 19, 2013 6:34 pm
by buchacho
Thanks, I did try

Code: Select all

put empty into btn ...
However, it puts the button name into the first option line. Right now I have it as:

Code: Select all

put "-" into btn ....
Not ideal, but it works...

Re: Option Menus

Posted: Wed Jun 19, 2013 6:52 pm
by Dixie
Yes it will do that... my fault.

Re: Option Menus

Posted: Wed Jun 19, 2013 7:02 pm
by dunbarx
You could put "space" or an invisible character..

Craig Newman

Re: Option Menus

Posted: Thu Jun 20, 2013 5:38 pm
by snm
Dixie wrote:To clear the menu items in the option menu

Code: Select all

 put empty into button "theNameOfThebutton"
then put your new list of things into it...

Code: Select all

put "Able,Baker,Charlie,Delta" into theNewList
repeat with count = 1 to the number of items of theNewList
   put item count of theNewList & cr after button "theNameOfThebutton"
end repeat
Simpler way:

Code: Select all

put "Able,Baker,Charlie,Delta" into theNewList
replace "," with cr in theNewlist
put theNewList into button "theNameOfTheButton"
and no problem with empty menu option.

Marek