Skip to Content
⚠ Under Construction
ReferenceC++ APIToggle

endstone::Toggle

Represents a toggle button with a label.

Functions:

NameDescription
Toggle
Toggle
getDefaultValueGets the default value of the toggle.
getLabelGets the label of the toggle.
setDefaultValueSets the default value of the toggle.
setLabelSets the label of the toggle.

Toggle

Toggle() = default
Toggle(Message label, bool default_value = false)

getDefaultValue

bool getDefaultValue() const

Gets the default value of the toggle.

Returns:

The default value of the toggle.

getLabel

Message getLabel() const

Gets the label of the toggle.

Returns:

The label of the toggle.

setDefaultValue

Toggle &setDefaultValue(bool value)

Sets the default value of the toggle.

Parameters:

  • value The new default value for the toggle.

Returns:

A reference to the current toggle.

setLabel

Toggle &setLabel(Message label)

Sets the label of the toggle.

Parameters:

  • label The new label for the toggle.

Returns:

A reference to the current toggle.

Last updated on