Custom Properties

Devin Asay devin_asay at byu.edu
Wed Apr 12 17:26:13 EDT 2006


On Apr 12, 2006, at 11:44 AM, Thomas McGrath III wrote:

> Does anyone have any examples on the get/setProps in real usage? I  
> have been using custom props but not the setProp etc. I would love  
> some more insightful ideas on it's usage.

The way I use it is much more pedestrian than the Marks'. For me it's  
a really easy way to make sure my interface objects get set to the  
proper states. For example, let's say I want to toggle between an  
'editable' and 'noneditable' mode for a text editor:

setProp editMode pMode
   if pMode then
     enable button "Save"
     enable button "TextColor"
     set the lockText of fld "myfld" to true
     set the traversalOn of fld "myFld" to true
   else
     disable button "Save"
     disable button "TextColor"
     set the lockText of fld "myfld" to false
     set the traversalOn of fld "myFld" to false
   end if
   pass editMode -- the docs say you have to explicitly pass it to  
have it set the prop
end editMode

Anyway, this is a crude example, but illustrates how it's been most  
useful to me. There may be several events in my program that could  
trigger a change in edit mode for this field, but in each case all  
I'd have to do would be to

   set the editMode of cd "editor" to true ## or false

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list