Contextual Menus

J. Landman Gay jacque at hyperactivesw.com
Mon Jul 21 21:36:18 EDT 2008


Bill Vlahos wrote:
> 
> Note there is no UI in the Properties of a button to set traversalOn. I 
> had to do it from the message box. Not obvious for a beginner.

I recommend setting your Rev preferences to show labels as the "name of 
transcript property" (in the General prefs pane) rather than showing 
just the general description (which is the default.) That's the first 
thing I always do. It really helps if the inspector labels match the 
scripting keywords (and it helps newcomers learn the language faster 
too.) If you do that, you'll see "traversalOn".

> 
> One last question... How do I refer to the calling object (in this case 
> the field) to send the action to? Lets say I have multiple fields that I 
> want to use this for so I want to cut the selected text in the field I 
> right clicked in. The menuPick handler is in the button.

Assuming there is some text selected in the field, you'd want either 
"the selection" (which is the text itself) or the "selectedChunk", which 
is a description of where the text is. If you get the selectedChunk, the 
last part of the description is the field, and you can parse that out. 
If you just want to operate on the text, you can do things like "copy 
the selection".

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list