GUI objects let Expr scripts create custom dialogs, forms, controls, and visual content. They are host application objects, so they are mainly used in custom UI scripts.
The main pattern is:
class Demo() { wnd = none(); function close() { wnd.request_close(); } function show() { wnd = window().title('Example').size(320, 160); wnd.add(label().position(10, 10).size(260, 24).text('Hello')); wnd.add(textbutton().position(10, 50).size(100, 28).text('Close').on_click(this.close)); wnd.show(); } } demo = Demo(); demo.show();
| Constructor | Page | Description |
|---|---|---|
| `window()` | window | Top-level custom Expr window. |
| `panel()` | panel | General-purpose container panel. |
| `group()` | group | Titled container group. |
| `splitpanel()` | splitpanel | Two-pane split container. |
| `label()` | label | Static text label. |
| `textbutton()` | textbutton | Push button with text. |
| `drawablebutton()` | drawablebutton | Button with an image. |
| `togglebutton()` | togglebutton | Checkable button. |
| `togglegroup()` | togglegroup | Group of selectable toggle choices. |
| `textinput()` | textinput | Single-line text input. |
| `textedit()` | textedit | Text editor. |
| `numinput()` | numinput | Numeric input field. |
| `slider()` | slider | Numeric slider. |
| `combobox()` | combobox | Drop-down list. |
| `listbox()` | listbox | List selection control. |
| `progressbar()` | progressbar | Progress display. |
| `led()` | led | Status indicator. |
| `separator()` | separator | Horizontal or vertical separator. |
| `menu()` | menu | Window menu and returned `menu_item` objects. |
| `image()` | image | Image display and drawing control. |
| `snake()` | snake | Snake game widget. |
Previous: msg_password
Next: window