A multi-state button for WsGUI.
Create new instance and add it to the window immediately.
Create new instance without adding it to the window. Use this when using WsLayout.
wsWindow |
An instance of |
bounds |
A NOTE: Currently a relative measurement is used: 1 for full window width, 1 for full window height, e.g. Rect(0, 0, 1, 1) would occupy whole window. |
an instance of the widget
An array of labels and colors defining the states of the button.
statesArray |
An |
Sets the current state. Does not trigger the action.
val |
An integer setting the state number. |
Sets the current state and triggers the action.
val |
An integer setting the state number. |
Current state's text.
Gets or sets function to be evaluated when the button is pressed.
function |
Any object to set as default action, usually a Function. It is passed the current instance. |
Get/set a text content for applicable widgets.
thisString |
A string to be set. |
current string
Change alignment of the text.
align |
Can be |
Current alignment.
Change the font of the text for applicable widgets.
font |
An instance of |
Current font.
Add to window/page specified in *init.
Removes the widget from the window.