Checkbox (체크박스) Widget Control
Example file: 07_Work_with_Widgets/checkbox_objet.lfp
The Widget Controls (Property · Method · Event) you use to control the Checkbox widget from a script. For an introduction to the widget and how to use it, see Checkbox.
In the examples below, checkboxID is the name (ID) you assigned to the Checkbox widget on the canvas. In a script, access it as widgetID.member.
Widget Control summary
| Widget Control | Kind | Signature | Description |
|---|---|---|---|
check | Property | boolean (Read/write) | Current checked state |
onChanged | Event | onChanged = (value) => { ... } | Runs when the checked state changes |
Property
check
The current checked state. true means checked. Both reading and writing are supported.
- Type:
boolean - Access: Read / write
Example
// Change it to the checked state
checkboxID.check = true;
// Read the current state
const isChecked = checkboxID.check;
Method
Not applicable — the Checkbox widget has no dedicated Method. Use the common Widget Control below.
Event
onChanged
Runs when the checked state changes.
- Kind: Event
- Handler arguments
value(boolean): The checked state after the change (truemeans checked)
- Returns: None
Example
checkboxID.onChanged = (value) => {
// value: the new checked state
};
Common Widget Control (all widgets)
Every widget can also use common Widget Controls (Method) such as setProperty(name, value) / getProperty(name) / setStyleProperty(styleName, styleProperty, value). For the full rules, see the common Widget Control reference.