FANDOM


If you have a project and you need to uniform all items of your interface (colors, buttons,sizes, etc.), you may use the properties array.

First of all create the standard item (button or else) that will be used as a template. We will name it myTemplate, the let's copy the properties:

put the properties of button "myTemplate" into temp
set myButtonTemplate of this stack to temp

Now the custom property myButtonTemplate contains an array with all the properties of the button. We must delete the properties that we don't want to change in the existing buttons:

put the myButtonTemplate of this stack into temp
delete variable temp["rect"]
delete variable temp["loc"]
delete variable temp["script"]
set myButtonTemplate of this stack to temp

Finally let's create command to apply the properties:

on applyTemplate tButton
 put the myButtonTemplate of this stack into temp
 set the properties of button tButton
end applyTemplate

So now just use: applyTemplate "MyButtonName" to get the button customized.