Toggle Button
fun ToggleButton( posX: Number = 0, posY: Number = 0, width: Number = DEFAULT_TOGGLE_BUTTON_WIDTH, height: Number = DEFAULT_TOGGLE_BUTTON_HEIGHT, text: String = "", font: Font = Font(), alignment: Alignment = Alignment.CENTER_LEFT, isWrapText: Boolean = false, isSelected: Boolean = false, toggleGroup: ToggleGroup = ToggleGroup(), visual: Visual = Visual.EMPTY)
Content copied to clipboard
Creates a ToggleButton.
Parameters
pos X
Horizontal coordinate for this ToggleButton. Default: 0.
pos Y
Vertical coordinate for this ToggleButton. Default: 0.
width
Width for this ToggleButton. Default: DEFAULT_TOGGLE_BUTTON_WIDTH.
height
Height for this ToggleButton. Default: DEFAULT_TOGGLE_BUTTON_HEIGHT.
text
Text to be displayed for this ToggleButton.
font
Font to be used for this ToggleButton. Default: default Font constructor.
alignment
Alignment to be used for this ToggleButton.
is Wrap Text
Defines if text should be wrapped, if it exceeds the label's width. Default: false
.
is Selected
The initial state for this ToggleButton. Default: false
.
toggle Group
The ToggleGroup of this ToggleButton. Default: empty group.
visual
Background Visual. Default: Visual.EMPTY.