User Tools

Site Tools


button

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
button [2020/12/01 10:04] justinbutton [2020/12/01 10:04] justin
Line 20: Line 20:
 You can access and change certain properties of a button from within a [[script]] by simply referencing the parent [[widget]] and the button element by their unique IDs. See below for examples of changing the text, [[image]], and [[script]] of a button. In these cases, the [[widget]] has an ID of "test" and the button has an ID of "0001". You can access and change certain properties of a button from within a [[script]] by simply referencing the parent [[widget]] and the button element by their unique IDs. See below for examples of changing the text, [[image]], and [[script]] of a button. In these cases, the [[widget]] has an ID of "test" and the button has an ID of "0001".
  
-Changing a button's text:+**Changing a button's text:**
 <code bauxite> <code bauxite>
 widget["test"].element["0001"].text = "New Text" widget["test"].element["0001"].text = "New Text"
 </code> </code>
  
-Changing a button's image:+**Changing a button's image:**
 <code bauxite> <code bauxite>
 widget["test"].element["0001"].image = "new_image.png" widget["test"].element["0001"].image = "new_image.png"
 </code> </code>
  
-Changing a button's script:+**Changing a button's script:**
 <code bauxite> <code bauxite>
 widget["test"].element["0001"].script = "new_script_name" widget["test"].element["0001"].script = "new_script_name"
button.txt · Last modified: 2021/06/24 21:18 by justin