Wrap (랩) Widget Control
This page lists the Widget Controls (Property · Method · Event) you use to control the Wrap widget from a script. To learn about the widget itself and how to use it, visit Wrap.
In the examples below, wrapID is the name (ID) you gave the Wrap widget on the canvas. In a script, you access it as widgetID.member.
Widget Control summary
| Widget Control | Kind | Signature | Description |
|---|---|---|---|
lineCount | Property | const n = wrapID.lineCount | Number of lines (rows or columns) currently laid out (read-only) |
onLineCountChanged | Event | onLineCountChanged = (lineCount) => { ... } | Runs only when the number of displayed lines changes |
Property
lineCount
The number of lines currently laid out on screen — rows for a horizontal layout, columns for a vertical one. It updates automatically whenever children wrap.
- Kind: Property (read-only)
- Type:
number(integer) - Write: Not supported (read-only)
Example
const count = wrapID.lineCount;
console.log(`현재 줄 수: ${count}`);
Method
Not applicable — the Wrap widget has no dedicated Method. Use the common Widget Controls below.
Event
onLineCountChanged
Runs only when the number of displayed lines changes. It fires the moment children are added or removed, or resized, so that the number of wrapped lines differs. Specify the action to run as a callback function.
- Kind: Event
- Handler: A callback function that receives the
lineCountargument (the new line count,number) - Returns: None
Example
wrapID.onLineCountChanged = (lineCount) => {
// code to run when the line count changes
console.log(`줄 수 변경: ${lineCount}`);
};
Common Widget Control (all widgets)
Every widget can use name-based common Widget Controls (Method) such as setProperty(name, value) / getProperty(name) / setStyleProperty(styleName, styleProperty, value). See the common reference doc (to be written).