Skip to content

luxe API (2025.1.2)


luxe: ui/check module


UICheck

import "luxe: ui/check" for UICheck

UICheck is a Control that represents a boolean toggle.

var check = UICheck.create(ui)
UICheck.set_state(check, true)
Control.set_events(check) {|event|
  if(event.type == UIEvent.change) {
    Log.print("Check is toggled %(event.change ? "on" : "off")")
  }
}

UICheck.create(ui_entity: Entity) returns UICheck

Create a new check control.

UICheck.set_state(control: UICheck, state: Bool) returns None

Set the current state of a check.

UICheck.get_state(control: UICheck) returns Bool

Get whether a check is toggled on or off.