ToggleButton:
Filter:
Classes (extension) | Libraries > crucial > GUI

ToggleButton : SCButtonAdapter : SCViewHolder : Object
ExtensionExtension

simple two state button

Description

Class Methods

ToggleButton.new(layout, title, onFunction, offFunction, init: false, minWidth: 20, minHeight, onColor, offColor)

Arguments:

layout
title
onFunction
offFunction
init
minWidth

button width is calculated to fit the title setting minWidth will widen the button to a minimum width

minHeight

default is the GUI.skin.buttonHeight

onColor
offColor

Inherited class methods

Instance Methods

.state

.onFunction

.onFunction = value

.offFunction

.offFunction = value

.value

.value = way

set the value, not doing the action

Arguments:

way

.toggle(way, doAction: true)

with no arguments it toggles the state, doing the action or may set the value explicitly (like value_ but doing the action as well)

Arguments:

way
doAction

boolean: if the action handler should be run

.init(layout, init, title, minWidth, minHeight, onc, offc)

Arguments:

layout
init
title
minWidth
minHeight
onc
offc

.prSetState(newstate)

Arguments:

newstate

Inherited instance methods