Sidebar

Home



Expressions V4


Tutorials

How-To

Reference

  Lexical basics
  Type system
  Variables and assignment
  Operators
  Expression rules
  Control flow
  Functions
  Built-in functions
   None and NaN
   Arithmetic
   Algebra
   Logarithmic and Exponential
   Trigonometric
   Rounding and Centering
   Strings
   Output, Formatting, Clipboard, and Errors
   Dialog Functions
   Platform and Paths
  Methods and properties
  Built-in methods
   Common Value Methods
   Number Methods
   String Basic Methods
   String Slice Methods
   String Parsing Methods
   String Formatting Methods
   String Regex Methods
   String Trim and Case Methods
  Objects
  Built-in objects
   Global objects
    settings
    controller
    session
    python
   Collections
    array
    map
    bytes
   File Format I/O
    image_data
    image_stream
   Utils
    crypto
    timer
   Comm
    serial
   Dialogs
    file_open
    file_save
    msg_ok
    msg_ok_cancel
    msg_yes_no
    msg_password
   GUI objects
    window
    panel
    group
    splitpanel
    label
    textbutton
    drawablebutton
    togglebutton
    togglegroup
    textinput
    textedit
    numinput
    slider
    combobox
    listbox
    progressbar
    led
    separator
    menu
    image
    snake
  Classes and user-defined objects
  Include system
  Error model
  Execution model and sessions
  Host integration
  Limits and performance
  Formal reference
  Glossary

Cookbook

exprv4:reference:objects:gui_objects

GUI Objects

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:

  1. Create controls.
  2. Configure them with methods.
  3. Add controls to a container or window.
  4. Keep the window object alive while it is open.
  5. Show the window.
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();

Object Pages

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

exprv4/reference/objects/gui_objects.txt · Last modified: by 127.0.0.1

Page Tools