Menus, buttons and how to refer to them

Graham Samuel livfoss at blueyonder.co.uk
Mon Dec 30 12:27:01 EST 2002


Thanks to all who have replied so far to my menu queries. I'm 
learning a lot (one thing is that a hidden menubar is an inactive 
menubar - common sense, I suppose, but I never thought of it). I may 
well be confused (I am!) but it's not entirely because I came from 
SuperCard - I think there is some slightly unexpected syntax in the 
way one refers to objects in Transcript.  For example, Jan Schenkel 
said:

>The reason why

  set line 1 of the text of button "Options" of card 1 of this stack to "Blah"

>  doesn't work is that it can't find
>a property named "line 1 of the text".
>Try this:
>   put "Blah" into line 1 of the text of button \
>     "Options" of card 1 of this stack

So what that says is that you can't have a qualifier of a property, 
because 'the text of button.." IS a property, despite Björnke von 
Gierke saying that you can't use the 'set' command on text. You can, 
as Jan confirms later in his mail. Ken Ray also points out that you 
can use 'put' as with a field. The issues here appear to be

a) that qualifiers are forbidden when referring to properties - which 
is easy to remember once you know it.

b) button contents are properties and also containers like fields, 
which is subtle and not that easy to  pick up from the documentation.

Now, I know that menus are buttons in Revo and I'm quite happy about 
that, but I am a bit confused about when we use the term 'menu' and 
when we use the term 'button'. For example, in the 1.1 Transcript 
Dictionary, there's an example under 'MenuItem':

  enable menuItem 2 of menu "Option Menu"

I wondered - would this work the same if we wrote:

  enable menuItem 2 of button "Option Menu"

The answer where I am is that the version from the Dictionary doesn't 
work (it gives an error "Chunk: no such object"), but the second one 
works OK. Where does that leave the term 'menu' as an object 
descriptor?

Still trying to learn from the patient and knowledgeable folks on this list.

Graham

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



More information about the Use-livecode mailing list