Skip to main content

Button (버튼) Widget Control

The Widget Control (Property · Method · Event) entries you use to control the Button widget from a script. For an introduction and usage, visit Button.

info

Example file: 07_Work_with_Widgets/button_objet.lfp

info

In the examples below, buttonID is the name (ID) you gave the Button widget on the canvas. In scripts, access it as widgetID.event.

Widget Control summary

Widget ControlKindSignatureDescription
onClickEventonClick = () => { ... }Runs when you tap (click) the button

Property

info

Not applicable — the Button widget has no script-only Property. In scripts, read and write values with the common Widget Control (getProperty / setProperty) below.

Method

info

Not applicable — the Button widget has no dedicated Method. Use the common Widget Control below.

Event

onClick

Runs when you tap (click) the button. Assign a callback function to define what happens.

  • Kind: Event
  • Handler: a callback function with no arguments
  • Returns: None

Example

buttonID.onClick = () => {
// Code to run on click
};

Common Widget Control (all widgets)

note

Every widget also supports common Widget Control (Method) entries such as setProperty(name, value), getProperty(name), and setStyleProperty(styleName, styleProperty, value) — for example, buttonID.setProperty("text", "확인"). For the detailed rules, see the common Widget Control reference.