addressing menu items (was: Yet another menu question)

Graham Samuel livfoss at blueyonder.co.uk
Mon Dec 30 10:13:00 EST 2002


At 11:50 +0000 30/12/02, I wrote:
>[...]
>I wanted to use this feature to change the text of individual menu 
>items (for example to create menu item that toggles between 
>"Show..." and "Hide...".
>
>Well, if I execute in the message box
>
>   put line 1 of the text of button "Options" of card 1 of this stack
>
>I get the result I expected (a text, say "Show the picture" - 
>without the quotes, of course). But if I try to execute
>
>  set line 1 of the text of button "Options" of card 1 of this stack to "Blah"
>
>I get an error "Object can't set this property".
>
>What am I doing wrong?


Still don't know what I did wrong but I found out that this works 
(for a 2-item menu):

  set the text of button "Options" of cd 1 of stack "Test" to (gTogA & 
return & gTogB)

It seems that I have to

a) refer to the menu as a button - bringing into question when one 
should use the word 'menu' as an object specifier and when not (and 
why);

b) set the whole text, not a line at a time

Am I right, and if so, why?

TIA

Graham

-- 
-------------------------------------------------------------------
          Graham Samuel / The Living Fossil Co. / UK & France



More information about the Use-livecode mailing list