ToggleButton

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.

Properties

PropertyDescriptionRequiredIn templateDefaultScript
nameThe name of the widgetNoN/A_togglebuttonnnRead-only
xHorizontal screen positionYesNoN/AYes
yVertical screen positionYesNoN/AYes
widthWidth of the widgetNoYesNoneYes
heightHeight of the widgetNoYesNoneYes
templateTemplate to base the widget onNoN/AN/ANo
visibleWhether or not the widget is shownNoN/ATrueYes
normalimageThe image file to display when the togglebutton is uncheckedNoYesNoneYes
normalfocusimageThe image file to display when the togglebutton is unchecked and has the focusNoYesNoneYes
checkedimageThe image file to display when the togglebutton is checkedNoYesNoneYes
checkedfocusimageThe image file to display when the togglebutton is checked and has the focusNoYesNoneYes
enabledWhether or not the button is enabled (not currently used)NoNotrueYes
checkedWhether or not the togglebutton is checkedNoNofalseYes
actionUser action to bind to the togglebuttonNoNoNoneNo

Methods

The following methods are supported by togglebutton widgets:

MethodDescription
setfocus()Give focus to the togglebutton.

Events

The following events are triggered by togglebutton widgets:

EventDescription
OnClickOccurs when the button is clicked.
OnGotFocusOccurs when the button receives focus.
OnLostFocusOccurs when the button loses focus.