Menu Problem!

Ken Ray kray at sonsothunder.com
Wed Aug 17 13:13:18 EDT 2005


On 8/17/05 11:36 AM, "Lynch, Jonathan" <bnz2 at cdc.gov> wrote:

> I have used this sort of construction:
> 
> Put "Insert Row Below" into tChoice
> Send "menupick tChoice" to button "row options"
> 
> 
> And it worked fine, no need to use menuhistory at all. Is there a hidden
> danger I am not aware of?

Well, the "send menupick" activates the menu option, but doesn't change the
label on the menu to correspond to the choice. So if you only want to
simulate the menu selection without setting the button's label, then it's a
fine approach.

Here's a summary of actions that can be taken:

1) put "Blue" into tChoice
    send "menupick tChoice" to button 1

    --> triggers the menupick in the button and acts on the choice, but
doesn't change the button's label, nor does it set the menuitem that is
directly under the mouse when then option button is selected the next time
(Mac only).

2) put "Blue" into tChoice
    send "menupick tChoice" to button 1
    set the label of button 1 to "Blue"

    --> triggers the menupick in the button and acts on the choice, and sets
the label appropriately, but doesn't set the menuitem that is directly under
the mouse when then option button is selected the next time (Mac only).

3) set the menuhistory of button 1 to 1

    --> (Assuming that "Blue" is the first menu item) Triggers the menupick
in the button and acts on the choice, sets the label appropriately, and set
the menuitem that is directly under the mouse when then option button is
selected the next time (Mac only).

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list