Togglebuttons provide a way for a user to set a boolean value (also known as checkboxes in other systems). Of course these don't have to look like checkboxes - just something with two states. There is no built-in text caption - use in conjunction with a label if you need this.
| Property | Description | Required | In template | Default | Script |
|---|---|---|---|---|---|
| name | The name of the widget | No | N/A | _togglebuttonnn | Read-only |
| x | Horizontal screen position | Yes | No | N/A | Yes |
| y | Vertical screen position | Yes | No | N/A | Yes |
| width | Width of the widget | No | Yes | None | Yes |
| height | Height of the widget | No | Yes | None | Yes |
| template | Template to base the widget on | No | N/A | N/A | No |
| visible | Whether or not the widget is shown | No | N/A | True | Yes |
| normalimage | The image file to display when the togglebutton is unchecked | No | Yes | None | Yes |
| normalfocusimage | The image file to display when the togglebutton is unchecked and has the focus | No | Yes | None | Yes |
| checkedimage | The image file to display when the togglebutton is checked | No | Yes | None | Yes |
| checkedfocusimage | The image file to display when the togglebutton is checked and has the focus | No | Yes | None | Yes |
| enabled | Whether or not the button is enabled (not currently used) | No | No | true | Yes |
| checked | Whether or not the togglebutton is checked | No | No | false | Yes |
| action | User action to bind to the togglebutton | No | No | None | No |
The following methods are supported by togglebutton widgets:
| Method | Description |
|---|---|
| setfocus() | Give focus to the togglebutton. |