problem with popup menu buttons
Ken Ray
kray at sonsothunder.com
Sun Jan 26 13:25:01 EST 2003
> I also would like to know if there is any way to change the selection
> of a popup menu btn by script.
Well, if it is a "popup" or "pulldown" menu button, then you don't really
have a "selection"; that is, you select an item from the menu and do
whatever action you like. If you want the button's label to reflect your
choice you can do this:
on menuPick what
set the label of me to what
end menuPick
Setting it from somewhere else by script is as simple as setting the label
of the button to what you want.
If you're using an "option" menu button (which will automatically display
its label based on the selection you make), you can "set the menuHistory" of
the button to a number indicating the line of text in the button's menu that
you want. For example, if I had a popup menu btn with the contents:
Apple
Orange
Cherry
Grape
And "Apple" was showing, if I "set the menuHistory of btn 1 to 2", it will
show "Orange". Note that it also executes a menuPick on that item, so it
runs the code as if it was selected by the user. If you just want to change
the text but not simulate selecting the item, you can set the label of the
button to what you want.
I'm sorry I can't address your other Rev questions as I haven't experienced
what you've experienced. Perhaps someone from the RunRev staff can address
those...
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the use-livecode
mailing list