XU XUv0.13.1
中文

#ui/widgets

import: #ui/widgets

counts: 146 functions, 1915 methods, 98 types, 275 constants, 4 method sets

UI / WIDGETS · 46

Widgets component directory

Choose a component by purpose. Each has its own guide, API and experience.

Actions

Text input

Selection

Navigation

Data

Layout

Text & status

Feedback

Embedded content

Button, Checkbox, Progress, Scroll, Input / TextArea and retained View. Styles provides fonts, density, palettes, geometry and combined-state rules; StyledLabel caches layout. Local themes are complete snapshots. Register measurement with set_style_measure, call mark_measure after text changes, then layout_styled, place_editor and present_styled. Callbacks borrow themes, use node-local coordinates and must not mutate View or topology.

Usage and lifetimes

Extended controls and style switching

Switch, Radio, Slider, Stepper, Tabs, Select, Badge, Divider, Card and ListBox share Styles, combined-state paint rules, shadows and icon placement. Create widgets.style_switcher() to select dark, light or contrast presets. Use use_preset, set_text_scale and set_density, then apply to the retained View; cycle advances and applies a preset. These methods can fail, so handle their errors. Each View receives a complete style snapshot; explicit control overrides remain in effect.

Release examples (complete projects and source downloads): widgets · editor_workbench · style_gallery · controls_gallery

Apply shared styles to a retained View:

@main
#ui/widgets

fn configure(view $&widgets.View) int {
    $themes := widgets.style_switcher()
    themes.use_preset(widgets.THEME_LIGHT) or >>
    themes.set_text_scale(1.2) or >>
    themes.set_density(0.85) or >>
    themes.apply(view) or >>
    // Call this from a theme-switch action to advance and apply the preset.
    themes.cycle(view) or >>
    << 0
}
fn main() int { << 0 }

Component workshop: icon buttons, tooltips and passwords

The complete component_workshop project and source provide 46 entries with themes, density, 100%/140%/200% text, disabled, read-only and invalid states. Use the matching Xu 0.10.11 SDK. A successful Windows/Linux cross build does not establish target-machine GUI acceptance.

Screen.button_with_icon() creates an icon-and-text button; icon_button() creates an icon-only button. Each button owns its style snapshot. Set its own icon_size and ICON_LEADING/TRAILING/ABOVE/BELOW, then use measure_button() to place it at its content size. Embed resources with --www; the code below requires www/logo.png.

Tooltips default to top/center. set_tooltip_placement() selects a side with edge flipping. Ordinary pointer hover shows help after about 500 ms; keyboard or explicit focus shows it immediately. Leaving, clicking or scrolling dismisses it. Escape suppresses the current interaction until re-entry or refocus. Anchors fully outside their scroll clip do not show a tooltip.

password_input() enables a real single-line password Input, with one bullet per Unicode grapheme. set_password_visible() preserves value and selection. Paste works; copy and cut remain blocked when revealed. Native surrounding-text queries and XACP node text do not return the password. text_value() still returns the application value, so applications must manage storage and logging; masking does not encrypt memory.

@main
#ui/widgets

fn configure(screen $&widgets.Screen, styles &widgets.Styles) int {
    button := screen.button_with_icon("logo.png", "Build project") or >>
    $appearance := styles.button_variant(widgets.BUTTON_PRIMARY) or >>
    appearance.icon_placement = widgets.ICON_ABOVE
    appearance.icon_size = 32.0 * styles.text_scale
    screen.set_control_style(button, &appearance) or >>
    size := screen.measure_button(button) or >>
    screen.place(button, 24.0, 24.0, size.width, size.height) or >>
    tip := screen.tooltip(button, "Build project") or >>
    $placement := widgets.overlay_placement()
    placement.side = widgets.OVERLAY_RIGHT
    placement.align = widgets.OVERLAY_CENTER
    screen.set_tooltip_placement(tip, &placement) or >>
    password := screen.password_input("") or >>
    screen.place(password, 24.0, 160.0, 320.0, 48.0) or >>
    << 0
}
fn main() int { << 0 }

Examples · API declarations

Examples

These sources come from the official examples repository and can be copied or downloaded. Run them with a local Xu SDK in the complete project; network, database, and desktop examples require the corresponding services or assets.

16_ui_webview/editor_workbench/xuui_tokens/mod.xu

Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source

XuLocal SDK example
@xuui_tokens
// XUUI 0.1.1-dev.1; generated from tokens/tokens.json.
// Regenerate with npm run build; retain this provenance when vendoring.
#ui/draw
#ui/widgets

pub fn canvas(dark bool) draw.Color {
    if dark { << draw.rgb(16,14,18) }
    << draw.rgb(246,243,239)
}
pub fn surface(dark bool) draw.Color {
    if dark { << draw.rgb(25,22,28) }
    << draw.rgb(255,253,251)
}
pub fn elevated(dark bool) draw.Color {
    if dark { << draw.rgb(35,31,39) }
    << draw.rgb(238,235,231)
}
pub fn subtle(dark bool) draw.Color {
    if dark { << draw.rgb(44,39,49) }
    << draw.rgb(232,227,223)
}
pub fn text(dark bool) draw.Color {
    if dark { << draw.rgb(245,240,237) }
    << draw.rgb(40,35,41)
}
pub fn muted(dark bool) draw.Color {
    if dark { << draw.rgb(179,170,182) }
    << draw.rgb(109,98,110)
}
pub fn brand(dark bool) draw.Color {
    if dark { << draw.rgb(255,82,116) }
    << draw.rgb(190,18,60)
}
pub fn focus(dark bool) draw.Color {
    if dark { << draw.rgb(168,217,255) }
    << draw.rgb(0,95,158)
}
pub fn control_border(dark bool) draw.Color {
    if dark { << draw.rgb(138,126,144) }
    << draw.rgb(133,121,135)
}
pub fn on_brand(dark bool) draw.Color {
    if dark { << draw.rgb(25,12,18) }
    << draw.rgb(255,248,250)
}
pub fn danger(dark bool) draw.Color {
    if dark { << draw.rgb(255,142,157) }
    << draw.rgb(184,33,56)
}
pub fn danger_soft(dark bool) draw.Color {
    if dark { << draw.rgb(60,32,40) }
    << draw.rgb(251,230,233)
}

// Editor appearance for XU SDK 0.10.11. Other controls retain SDK defaults.
pub fn editor_styles(dark bool) widgets.Styles {
    $styles := widgets.light_styles()
    if dark { styles = widgets.dark_styles() }
    styles.background = canvas(dark)
    $input := styles.input.clone()
    input.radius = 8.0
    input.min_height = 40.0
    input.padding.left = 12.0
    input.padding.right = 12.0
    input.padding.top = 8.0
    input.padding.bottom = 8.0
    input.border_width = 1.0
    input.focus_width = 2.0
    input.font.size = 16.0
    input.inherit_font = false
    input.palette.normal = surface(dark)
    input.palette.hovered = surface(dark)
    input.palette.pressed = subtle(dark)
    input.palette.disabled = surface(dark)
    input.palette.foreground = text(dark)
    input.palette.muted = muted(dark)
    input.palette.placeholder = muted(dark)
    input.palette.accent = brand(dark)
    input.palette.on_accent = on_brand(dark)
    input.palette.focus = focus(dark)
    input.palette.border = control_border(dark)
    input.palette.invalid = danger(dark)
    input.palette.invalid_fill = danger_soft(dark)
    input.palette.read_only = subtle(dark)
    input.palette.selection = brand(dark)
    input.palette.selection_text = on_brand(dark)
    $hover := widgets.state_paint(widgets.STATE_HOVERED)
    hover.unless = widgets.STATE_DISABLED | widgets.STATE_INVALID | widgets.STATE_READ_ONLY
    hover.fields = widgets.PAINT_BORDER
    hover.border = brand(dark)
    $focused := widgets.state_paint(widgets.STATE_FOCUSED)
    focused.unless = widgets.STATE_DISABLED | widgets.STATE_INVALID
    focused.fields = widgets.PAINT_BORDER
    focused.border = focus(dark)
    input.states = [hover,focused]
    styles.input = input.clone()
    styles.text_area = input.clone()
    styles.text_area.align_y = 0.0
    << styles
}
16_ui_webview/webview_component/main.xu

Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu

Xumain.xu
@main
#ui
#ui/widgets
#ui/webview
#math
demo #"github.com/xulang-org/examples/ui_demo"

fn document(title string, tone string) string {
    << "<!doctype html><html><head><meta charset='utf-8'><title>" + title + "</title><style>body{margin:0;padding:28px;font:15px -apple-system,system-ui;color:#252521;background:#faf9f6}small{letter-spacing:.14em;color:#797970}h1{font-size:28px;font-weight:600;letter-spacing:-.04em;margin:16px 0}p{line-height:1.65;color:#6b6b63}input,button{box-sizing:border-box;font:inherit;border-radius:8px;padding:12px;width:100%;margin:8px 0}input{border:1px solid #d8d8cf;background:white;outline-color:" + tone + "}button{border:0;background:" + tone + ";color:white;cursor:pointer}output{display:block;min-height:42px;padding:12px 0;line-height:1.5;color:" + tone + "}</style></head><body><small>EMBEDDED WEBVIEW</small><h1>" + title + "</h1><p>This document has its own viewport, focus and request identity.</p><input aria-label='Message' value='Hello from " + title + "'><button onclick='send()'>Ask native Xu</button><output aria-live='polite'>Ready for an independent native request.</output><p>Tab moves inside this document.<br>Ctrl + Tab returns to the native controls.</p><script>async function send(){let out=document.querySelector('output');out.textContent='Waiting…';try{out.textContent=await window.__XU__.invoke('echo',document.querySelector('input').value)}catch(e){out.textContent=e.message}}</script></body></html>"
}
fn route(request webview.InvokeRequest) string {
    target := request.target() or(err) { << "Target closed: " + err.msg()}
    script := "document.title"
    options := ui.RequestOptions{timeout_ms: 3000}
    result := ui.webview_request_wait(&target, ui.REQUEST_WEBVIEW_EVAL, &script, &options) or(err) { << err.msg()}
    << result.value + " · " + request.payload + " · view " + str(target.canvas_id)
}
fn ipc(events chan ui.Event, emits chan string) {
    webview.bind_ipc_requests_www(":mem:", route, emits, events) or(err) {eprintln(err.msg())
        << }
}
fn scene(events chan ui.Event) int {
    ready := demo.ready(events) or >>
    if ready.kind == ui.EV_EXIT{ << 0}
    $screen := widgets.screen(&ready) or >>
    screen.resize(1020.0, 720.0) or >>
    screen.set_min_size(760, 580) or >>
    title := screen.label("Web content. Native composition.", 26.0, false) or >>
    subtitle := screen.label("Two independent WebViews inside a Canvas window", 13.0, true) or >>
    hide := screen.button("Hide left") or >>
    reload := screen.button("Reload right") or >>
    close := screen.button("Dispose left") or >>
    modal_button := screen.button("Open modal") or >>
    left := screen.webview() or >>
    right := screen.webview() or >>
    status := screen.label("Resize the window, edit both pages, or test their native requests.", 13.0, true) or >>
    modal := screen.modal("Native overlay", "The WebViews resume when this dialog closes.") or >>
    dismiss := screen.button("Close dialog") or >>
    screen.set_parent(dismiss, modal) or >>
    screen.place(dismiss, 24.0, 175.0, 180.0, 38.0) or >>
    screen.load_web_html(left, document("Editor preview", "#b64c3c")) or >>
    screen.load_web_html(right, document("Reference panel", "#386f6b")) or >>
    $model := Model{left: left, right: right, hide: hide, close: close, status: status, modal: modal, hidden: false, disposed: false}
    $dispatcher := widgets.action_dispatcher(&model, &screen)
    dispatcher.on(hide, widgets.ACTION_ACTIVATE, toggle_left) or >>
    dispatcher.on(reload, widgets.ACTION_ACTIVATE, reload_right) or >>
    dispatcher.on(close, widgets.ACTION_ACTIVATE, dispose_left) or >>
    dispatcher.on(modal_button, widgets.ACTION_ACTIVATE, open_modal) or >>
    dispatcher.on(dismiss, widgets.ACTION_ACTIVATE, close_modal) or >>
    for id in[left, right] {
        dispatcher.on(id, widgets.ACTION_WEB_LOADED, web_loaded) or >>
        dispatcher.on(id, widgets.ACTION_WEB_FAILED, web_failed) or >>
    }
    while screen.is_open() {
        width := screen.width()
        height := screen.height()
        half :=(width - 76.0) * 0.5
        screen.place(title, 28.0, 25.0, width - 56.0, 38.0) or >>
        screen.place(subtitle, 28.0, 69.0, width - 56.0, 25.0) or >>
        screen.place(hide, 28.0, 112.0, 136.0, 38.0) or >>
        screen.place(reload, 174.0, 112.0, 146.0, 38.0) or >>
        screen.place(close, 330.0, 112.0, 136.0, 38.0) or >>
        screen.place(modal_button, 476.0, 112.0, 136.0, 38.0) or >>
        screen.place(left, 28.0, 174.0, half, math.max(300.0, height - 245.0)) or >>
        screen.place(right, 48.0 + half, 174.0, half, math.max(300.0, height - 245.0)) or >>
        screen.place(status, 28.0, height - 49.0, width - 56.0, 28.0) or >>
        _ := screen.render() or >>
        for action in screen.next(events) or >> {
            _ := dispatcher.dispatch(&action, $&model, $&screen) or >>
        }
    }
    screen.dispose()
    << 0
}
fn worker(events chan ui.Event) {scene(events) or(err) {demo.fail(err.msg())
        << }}
fn launch() int {
    $app := demo.app("XUUI / WebView Components", 1020, 720) or >>
    _ := ui.register_content_plugin(ui.content_plugin_webview())
    emits := chan string {cap: 64}
    xu ipc(app.event_ch, emits)
    xu worker(app.event_ch)
    << app.run() or >>
}
fn main() int { << launch() or(err) {eprintln(err.msg())
        << 1}}
Xuevents.xu
@main

#ui
#ui/widgets

struct Model{left int
    right int
    hide int
    close int
    status int
    modal int
    hidden bool
    disposed bool}
fn toggle_left(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    if m.disposed{ << ""}
    m.hidden = !m.hidden
    screen.set_visible(m.left, !m.hidden) or(err) { << err.msg()}
    if m.hidden{screen.set_text(m.hide, "Show left") or(err) { << err.msg()}} else {screen.set_text(m.hide, "Hide left") or(err) { << err.msg()}}
    << ""
}
fn reload_right(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    screen.webview_command(m.right, "reload") or(err) { << err.msg()}
    << ""
}
fn dispose_left(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    if m.disposed{ << ""}
    screen.close_webview(m.left) or(err) { << err.msg()}
    m.disposed = true
    screen.set_enabled(m.hide, false) or(err) { << err.msg()}
    screen.set_enabled(m.close, false) or(err) { << err.msg()}
    << ""
}
fn open_modal(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    screen.open(m.modal) or(err) { << err.msg()}
    << ""
}
fn close_modal(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    screen.close_overlay(m.modal) or(err) { << err.msg()}
    << ""
}
fn web_loaded(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    screen.set_text(m.status, "WebView " + str(action.id) + " loaded independently") or(err) { << err.msg()}
    << ""
}
fn web_failed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    screen.set_text(m.status, "WebView " + str(action.id) + " failed to load") or(err) { << err.msg()}
    << ""
}
16_ui_webview/xacp_screen/main.xu

Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu

Xumain.xu
@main

#ui
#ui/widgets
#xacp
#errors

demo #"github.com/xulang-org/examples/ui_demo"

struct Model{
    label_id int
    count int
}

fn (m $&Model) layout(s $&widgets.Screen) int {
    s.place(m.label_id, 32.0, 36.0, 540.0, 44.0) or >>
    << 0
}

fn inspect_screen(s $&widgets.Screen) int {
    $session := xacp.open_session()
    // The in-process adapter follows the current session lifecycle too.
    // This token belongs only to this local demonstration; no listener is opened.
    permissions := xacp.PERM_UI_READ | xacp.PERM_UI_MUTATE
    limits := xacp.default_limits()
    $nonces := xacp.new_nonce_registry(8, true)
    hello := xacp.parse_frame("id: !i 1\nop: xacp.hello\nargs:\n  ver: !ver 1.0.0\n  nonce: local-screen-demo\n  token: local-screen-demo\n  permissions: !i " + str(permissions) + "\n") or(err) {
        xacp.close_session($&session)
        >> err
    }
    opened := xacp.dispatch_with_token($&session, &hello, &limits, "local-screen-demo", $&nonces)
    if !opened.ok{
        xacp.close_session($&session)
        >> errors.new("xacp_screen: " + opened.err_msg)
    }
    tree := xacp.ui_tree(& * s, $&session, 2, false, 0, 32, &limits) or(err) {
        xacp.close_session($&session)
        >> err
    }
    println("XACP ui.tree: " + str(tree.nodes.len) + " visible nodes")
    for node in tree.nodes{
        println("  #" + str(node.id) + " kind=" + str(node.kind) + " " + node.text)
    }

    $snapshot := xacp.ui_screenshot(& * s, $&session, 3, 1.0, &limits) or(err) {
        xacp.close_session($&session)
        >> err
    }
    println("XACP ui.screenshot: " + str(snapshot.pixel_width) + "x" + str(snapshot.pixel_height) + " pixels")
    snapshot.dispose() or(err) {
        xacp.close_session($&session)
        >> err
    }

    _ := xacp.ui_act(& * s, $&session, 2, 4, "focus", "", false, &limits) or(err) {
        xacp.close_session($&session)
        >> err
    }
    xacp.close_session($&session)
    << 0
}

fn scene(events chan ui.Event) int {
    ready := demo.ready(events) or >>
    if ready.kind == ui.EV_EXIT{ << 0}
    $screen := widgets.screen(&ready) or >>
    screen.resize(640.0, 180.0) or >>
    label_id := screen.label("XACP Screen adapter", 22.0, false) or >>
    button_id := screen.button("Activate locally or through ui.act") or >>
    screen.place(label_id, 32.0, 36.0, 540.0, 44.0) or >>
    screen.place(button_id, 32.0, 96.0, 360.0, 40.0) or >>
    inspect_screen($&screen) or(err) {
        screen.dispose()
        >> err
    }
    $model := Model{label_id: label_id, count: 0}
    $actions := widgets.action_dispatcher(&model, &screen)
    actions.on(button_id, widgets.ACTION_ACTIVATE, activate) or >>
    actions.set_fallback(global_key)
    << widgets.run_screen_actions($&screen, events, $&model, layout_action, &actions) or >>
}

fn worker(events chan ui.Event) {
    scene(events) or(err) {demo.fail(err.msg())
        << }
}

fn launch() int {
    $app := demo.app("Xu / XACP Screen adapter", 640, 180) or >>
    xu worker(app.event_ch)
    << app.run() or >>
}

fn main() int {
    << launch() or(err) {eprintln(err.msg())
        << 1}
}
Xuevents.xu
@main

#ui
#ui/widgets

fn activate(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    m.count += 1
    screen.set_text(m.label_id, "Button actions: " + str(m.count)) or(err) { << err.msg()}
    << ""
}
fn global_key(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
    if action.kind == widgets.ACTION_KEY && int(action.value) == ui.KEY_ESCAPE{screen.close() or(err) { << err.msg()}}
    << ""
}
fn layout_action(m $&Model, screen $&widgets.Screen) string {
    m.layout(screen) or(err) { << err.msg()}
    << ""
}
More related examples
  • 16_ui_webview/controls_gallery/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu · style.xu

    Xumain.xu
    @main
    #ui
    #ui/draw
    #ui/layout
    #ui/widgets
    demo #"github.com/xulang-org/examples/ui_demo"
    
    fn rect(x f64, y f64, width f64, height f64) layout.Rect{
        << layout.Rect{x: x, y: y, width: width, height: height}
    }
    
    // One worker owns the controls and their canvas resources. Every recorded
    // label remains alive until the complete frame has been accepted.
    fn scene(ech chan ui.Event) int {
        ready := demo.ready(ech) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        identity := ui.canvas_of(&ready) or >>
        context := draw.context_of(&ready) or >>
        $switcher := widgets.style_switcher()
        switcher.use_preset(widgets.THEME_LIGHT) or >>
        $toggle := widgets.switch_control(&identity, 1, &rect(48.0, 116.0, 280.0, 48.0), true) or >>
        $radio := widgets.radio(&identity, 2, &rect(48.0, 180.0, 280.0, 48.0), 1, false) or >>
        $slider := widgets.slider(&identity, 3, &rect(48.0, 260.0, 280.0, 36.0), 0.0, 100.0, 50.0) or >>
        slider.set_step(5.0) or >>
        $stepper := widgets.stepper(&identity, 4, &rect(48.0, 324.0, 280.0, 48.0), 0.0, 20.0, 1.0, 5.0) or >>
        $tabs := widgets.tabs(&identity, 5, &rect(376.0, 116.0, 348.0, 48.0), 3, 0) or >>
        $dropdown := widgets.select_box(&identity, 6, &rect(376.0, 196.0, 348.0, 48.0), 3, 0) or >>
        $list := widgets.list_box(&identity, 7, &rect(376.0, 284.0, 348.0, 132.0), 3, 0) or >>
        panel := widgets.card(&rect(24.0, 92.0, 724.0, 352.0)) or >>
        badge := widgets.badge(&rect(48.0, 392.0, 280.0, 32.0)) or >>
        divider := widgets.divider(&rect(48.0, 244.0, 280.0, 2.0), widgets.AXIS_HORIZONTAL) or >>
        $label0 := widgets.styled_label(&context, &"Enabled")
        $label1 := widgets.styled_label(&context, &"Choose this option")
        $label2 := widgets.styled_label(&context, &"Stepper")
        $label3 := widgets.styled_label(&context, &"One")
        $label4 := widgets.styled_label(&context, &"Two")
        $label5 := widgets.styled_label(&context, &"Three")
        $label6 := widgets.styled_label(&context, &"Select an option")
        $label7 := widgets.styled_label(&context, &"Xu 0.10.2")
        $label8 := widgets.styled_label(&context, &"One")
        $label9 := widgets.styled_label(&context, &"Two")
        $label10 := widgets.styled_label(&context, &"Three")
        $frame := context.new_frame(16384)
        $state := Model{dirty: true, focus: 0}
        $dispatcher := widgets.action_dispatcher(&state, &switcher)
        for id in 1:8 {dispatcher.on_any(id, control_action) or >> }
        while true {
            if state.dirty{
                styles := switcher.styles()
                frame.begin() or >>
                frame.set_bg(styles.background) or >>
                panel.paint_styled($&frame, &styles) or >>
                ink := styles.button.palette.foreground
                title := "Extended controls / " + switcher.name()
                frame.text(32.0, 28.0, 22.0, ink, &title) or >>
                toggle.paint_styled($&frame, $&label0, &styles) or >>
                radio.paint_styled($&frame, $&label1, &styles) or >>
                divider.paint_styled($&frame, &styles) or >>
                slider.paint_styled($&frame, &styles) or >>
                stepper.paint_styled($&frame, $&label2, &styles) or >>
                tabs.paint_box_styled($&frame, &styles) or >>
                list.paint_box_styled($&frame, &styles) or >>
                tabs.paint_tab_styled($&frame, 0, $&label3, &styles) or >>
                list.paint_item_styled($&frame, 0, $&label8, &styles) or >>
                tabs.paint_tab_styled($&frame, 1, $&label4, &styles) or >>
                list.paint_item_styled($&frame, 1, $&label9, &styles) or >>
                tabs.paint_tab_styled($&frame, 2, $&label5, &styles) or >>
                list.paint_item_styled($&frame, 2, $&label10, &styles) or >>
                dropdown.paint_styled($&frame, $&label6, &styles) or >>
                badge.paint_styled($&frame, $&label7, &styles) or >>
                frame.text(32.0, 464.0, 15.0, ink, &"T: theme / S: text size / D: density / Tab: focus / Esc: quit") or >>
                status := "Slider " + str(int(slider.value())) + " / Stepper " + str(int(stepper.value())) + " / Select " + str(dropdown.selected() + 1)
                frame.text(32.0, 494.0, 15.0, ink, &status) or >>
                // A Select popup overlays the scene; this basic painter repeats
                // its label. The selected option index is shown in the status.
                dropdown.paint_popup_styled($&frame, $&label6, &styles) or >>
                // This worker can repaint for a burst of control and appearance actions.
                frame.present_wait() or >>
                toggle.painted()
                radio.painted()
                slider.painted()
                stepper.painted()
                tabs.painted()
                dropdown.painted()
                list.painted()
                state.dirty = false
            }
            event := demo.next(ech)
            if event.kind == ui.EV_EXIT{ <- }
            if event.window_id != identity.window_id{ -> }
            if event.kind == ui.EV_CANVAS_CLOSED{ <- }
            if event.kind == ui.EV_CANVAS_METRICS{state.dirty = true}
            if ui.is_input_event(event.kind) {
                input := ui.input_of(&event) or >>
                if input.generation != identity.generation{ -> }
                if input.kind == ui.EV_KEY_DOWN && input.repeat == 0 {
                    if input.key == ui.KEY_ESCAPE{
                        // App shutdown revokes canvas resources. Do not enqueue
                        // another frame while the native host is closing.
                        demo.quit() or >>
                        << 0
                    }
                    if appearance_key($&switcher, &input) or >> {state.dirty = true}
                    if input.key == ui.KEY_TAB{state.focus = state.focus % 7 + 1
                        state.dirty = true}
                }
            }
            // Route the popup first. A modal option click must not also focus
            // or activate the ListBox underneath it.
            popup_open := dropdown.is_open()
            first := dropdown.event(&event) or >>
            $actions :=[first]
            if !popup_open && !first.consumed{
                actions.push(toggle.event(&event) or >>)
                actions.push(radio.event(&event) or >>)
                actions.push(slider.event(&event) or >>)
                actions.push(stepper.event(&event) or >>)
                actions.push(tabs.event(&event) or >>)
                actions.push(list.event(&event) or >>)
            }
            for action in actions{
                if !(dispatcher.dispatch(&action, $&state, $&switcher) or >>) {
                    // ACTION_NONE may carry focus/repaint metadata without a semantic event.
                    action_state($&state, &action)
                }
            }
            toggle.set_focus(state.focus == 1)
            radio.set_focus(state.focus == 2)
            slider.set_focus(state.focus == 3)
            stepper.set_focus(state.focus == 4)
            tabs.set_focus(state.focus == 5)
            dropdown.set_focus(state.focus == 6)
            list.set_focus(state.focus == 7)
        }
        frame.dispose()
        if demo.alive(&identity) {
            label0.dispose()
            label1.dispose()
            label2.dispose()
            label3.dispose()
            label4.dispose()
            label5.dispose()
            label6.dispose()
            label7.dispose()
            label8.dispose()
            label9.dispose()
            label10.dispose()
        }
        << 0
    }
    fn worker(ech chan ui.Event) {
        scene(ech) or(err) {demo.fail(err.msg())
            << }
    }
    fn launch() int {
        $app := demo.app("Xu UI / Extended Controls", 780, 552) or >>
        xu worker(app.event_ch)
        << app.run() or >>
    }
    fn main() int {
        << launch() or(err) {eprintln(err.msg())
            << 1}
    }
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    
    struct Model{dirty bool
        focus int}
    fn action_state(m $&Model, action &widgets.Action) {
        if action.request_focus{m.focus = action.id}
        if action.needs_paint{m.dirty = true}
    }
    fn control_action(m $&Model, switcher $&widgets.StyleSwitcher, action &widgets.Action) string {
        action_state(m, action)
        << ""
    }
    Xustyle.xu
    @main
    
    #ui
    #ui/widgets
    
    fn appearance_key(switcher $&widgets.StyleSwitcher, input &ui.InputEvent) bool {
        if input.key == 84 || input.key == 116 {switcher.next() or >>
            << true}
        if input.key == 83 || input.key == 115 {
            $scale := 1.4
            if switcher.text_scale() > 1.0 {scale = 1.0}
            switcher.set_text_scale(scale) or >>
            << true
        }
        if input.key == 68 || input.key == 100 {
            $density := 0.85
            if switcher.density() < 1.0 {density = 1.0}
            switcher.set_density(density) or >>
            << true
        }
        << false
    }
  • 16_ui_webview/component_catalog/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu · style.xu

    Xumain.xu
    @main
    #ui
    #ui/widgets
    #ui/draw
    #time
    #math
    demo #"github.com/xulang-org/examples/ui_demo"
    
    // The model contains business choices and screen-local handles only.
    struct Model{
        page int
        theme int
        text_scale f64
        density f64
        appearance_dirty bool
        nav []int
        settings []int
        pages []int
        headings []int
        captions []int
        table int
        tree int
        pager int
        crumbs int
        combo int
        multi int
        color int
        spinner int
        overlay_buttons []int
        popover int
        modal int
        modal_actions []int
        value_label int
        note int
    }
    fn (m &Model) fill_table(screen $&widgets.Screen) int {
        names :=["Compiler", "Widgets", "Runtime", "Desktop", "Examples", "Tooling"]
        states :=["Ready", "Review", "Ready", "Draft", "Ready", "Review"]
        clocks :=["10:30", "11:15", "09:40", "12:00", "10:05", "08:50"]
        $order :=[0, 1, 2, 3, 4, 5]
        col := screen.sort_column(m.table) or >>
        if col == 0 {order =[0, 3, 4, 2, 5, 1]}
        if col == 1 {order =[3, 0, 2, 4, 1, 5]}
        if col == 2 {order =[5, 2, 4, 0, 1, 3]}
        desc := screen.sort_descending(m.table) or >>
        page :=(screen.selected(m.pager) or >>) + 1
        for row in 0:6 {
            $slot := row
            if desc{slot = 5 - row}
            i := order[slot]
            screen.set_cell(m.table, row, 0, names[i] + " / " + str(page)) or >>
            screen.set_cell(m.table, row, 1, states[i]) or >>
            screen.set_cell(m.table, row, 2, clocks[i]) or >>
        }
        << 0
    }
    fn (m $&Model) layout(screen $&widgets.Screen) int {
        width := screen.width()
        height := screen.height()
        row := screen.row_height()
        for i in 0:3 {
            screen.place(m.nav[i], 28.0 + f64(i) * 124.0, 142.0, 112.0, row) or >>
            screen.set_selected_button(m.nav[i], m.page == i) or >>
            screen.set_visible(m.pages[i], m.page == i) or >>
            screen.place(m.settings[i], width - 420.0 + f64(i) * 132.0, 142.0, 120.0, row) or >>
        }
        screen.place(m.headings[0], 28.0, 26.0, width - 56.0, 24.0) or >>
        screen.place(m.headings[1], 28.0, 61.0, width - 56.0, 46.0) or >>
        screen.place(m.headings[2], 28.0, 108.0, width - 56.0, 30.0) or >>
        screen.place(m.crumbs, 28.0, 204.0, width - 56.0, row) or >>
        screen.place(m.note, 28.0, height - 48.0, width - 56.0, 30.0) or >>
        content := math.max(160.0, height - 420.0)
        screen.place(m.captions[0], 28.0, 253.0, width * 0.62 - 40.0, 30.0) or >>
        screen.place(m.captions[1], width * 0.62 + 12.0, 253.0, width * 0.38 - 40.0, 30.0) or >>
        screen.place(m.table, 28.0, 280.0, width * 0.62 - 40.0, content) or >>
        screen.place(m.tree, width * 0.62 + 12.0, 280.0, width * 0.38 - 40.0, content) or >>
        screen.place(m.pager, 28.0, height - 118.0, 380.0, row) or >>
        screen.place(m.captions[2], 28.0, 253.0, 400.0, 30.0) or >>
        screen.place(m.captions[3], 28.0, 363.0, 400.0, 30.0) or >>
        screen.place(m.captions[4], 450.0, 253.0, width - 478.0, 30.0) or >>
        screen.place(m.combo, 28.0, 280.0, 370.0, row) or >>
        screen.place(m.multi, 28.0, 390.0, 370.0, row) or >>
        screen.place(m.color, 450.0, 280.0, width - 478.0, 240.0) or >>
        screen.place(m.spinner, 28.0, 562.0, 28.0, 28.0) or >>
        screen.place(m.captions[5], 70.0, 568.0, width - 98.0, 30.0) or >>
        screen.place(m.value_label, 28.0, 620.0, width - 56.0, 36.0) or >>
        screen.place(m.captions[6], 28.0, 253.0, width - 56.0, 30.0) or >>
        for i in 0:4 {screen.place(m.overlay_buttons[i], 28.0 + f64(i) * 208.0, 280.0, 190.0, row) or >>
            screen.place(m.captions[i + 7], 28.0, 365.0 + f64(i) * 40.0, width - 56.0, 32.0) or >> }
        screen.place(m.modal_actions[0], 24.0, 210.0, 194.0, row) or >>
        screen.place(m.modal_actions[1], 234.0, 210.0, 194.0, row) or >>
        << 0
    }
    fn new_model(screen $&widgets.Screen) Model{
        $nav :=[]int {}
        for text in["Data", "Inputs", "Overlays"] {nav.push(screen.button(text) or >>)}
        $settings :=[]int {}
        for text in["Theme", "Text size", "Density"] {settings.push(screen.button(text) or >>)}
        $pages :=[]int {}
        for i in 0:3 {pages.push(screen.group() or >>)}
        headings :=[screen.label("XUUI / COMPONENT CATALOG", 12.0, true) or >>,
        screen.label("Native components, working together.", 26.0, false) or >>,
        screen.label("Keyboard, pointer, themes, typography and density — managed by Screen.", 13.0, true) or >>]
        crumbs := screen.breadcrumbs(&["Workspace", "UI", "Component catalog"]) or >>
        note := screen.label("Choose a category · Tab / Shift+Tab · Escape", 13.0, true) or >>
        table := screen.table(&["Module", "State", "Updated"], 6, 0) or >>
        tree := screen.tree() or >>
        pager := screen.pagination(3, 0) or >>
        combo := screen.combo_box(&["Compiler", "Widgets", "Runtime", "Desktop", "Examples", "工具链"], "") or >>
        multi := screen.multi_select(&["Native", "Keyboard", "IME", "Theming", "Motion"]) or >>
        screen.set_checked(multi, 0, true) or >>
        color := screen.color_picker(draw.rgba(59, 130, 246, 220)) or >>
        spinner := screen.spinner() or >>
        value_label := screen.label("Value:    Selected tags: 1", 14.0, false) or >>
        $overlay_buttons :=[]int {}
        for text in["Open popover", "Open modal", "Show toast", "Hover / focus me"] {overlay_buttons.push(screen.button(text) or >>)}
        popover := screen.popover(overlay_buttons[0], "An anchored panel for related actions.") or >>
        modal := screen.modal("Keep focus where it belongs", "Screen owns focus, input isolation and restoration.") or >>
        _ := screen.tooltip(overlay_buttons[3], "Pointer and keyboard share this hint.") or >>
        modal_actions :=[screen.button("Complete action") or >>, screen.button("Close") or >>]
        for id in modal_actions{screen.set_parent(id, modal) or >> }
        $captions :=[]int {}
        for text in["TABLE / sort columns · select rows · scroll", "TREE / expand · navigate",
        "COMBO BOX / type to filter · native IME", "MULTI SELECT / independent choices",
        "COLOR PICKER / red · green · blue · alpha", "Loading indicator · respects reduced motion",
        "OVERLAYS / anchor placement · focus ownership · timed feedback",
        "Popover: anchored to its trigger and constrained to the canvas.",
        "Modal: Tab stays inside; Escape closes; focus returns to the trigger.",
        "Toast: closes automatically; hover or focus pauses its lifetime.",
        "Tooltip: hover or keyboard focus reveals a delayed explanation."] {captions.push(screen.label(text, 13.0, true) or >>)}
        for id in[table, tree, pager, captions[0], captions[1]] {screen.set_parent(id, pages[0]) or >> }
        for id in[combo, multi, color, spinner, value_label, captions[2], captions[3], captions[4], captions[5]] {screen.set_parent(id, pages[1]) or >> }
        for id in overlay_buttons{screen.set_parent(id, pages[2]) or >> }
        screen.set_parent(popover, pages[2]) or >>
        for i in 6:11 {screen.set_parent(captions[i], pages[2]) or >> }
        root := screen.tree_add(tree, - 1, "XU Workspace") or >>
        compiler := screen.tree_add(tree, root, "Compiler") or >>
        _ := screen.tree_add(tree, compiler, "Frontend") or >>
        _ := screen.tree_add(tree, compiler, "Native backend") or >>
        ui_root := screen.tree_add(tree, root, "UI") or >>
        _ := screen.tree_add(tree, ui_root, "Widgets") or >>
        _ := screen.tree_add(tree, ui_root, "Drawing") or >>
        _ := screen.tree_add(tree, root, "Examples") or >>
        for node in[root, compiler, ui_root] {screen.set_expanded(tree, node, true) or >> }
        m := Model{page: 0, theme: 1, text_scale: 1.0, density: 1.0, appearance_dirty: true, nav: nav, settings: settings, pages: pages, headings: headings, captions: captions,
            table: table, tree: tree, pager: pager, crumbs: crumbs, combo: combo, multi: multi, color: color, spinner: spinner,
            overlay_buttons: overlay_buttons, popover: popover, modal: modal, modal_actions: modal_actions, value_label: value_label, note: note}
        m.fill_table(screen) or >>
        << m
    }
    fn scene(events chan ui.Event) int {
        ready := demo.ready(events) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        $screen := widgets.screen(&ready) or >>
        screen.resize(1040.0, 820.0) or >>
        screen.set_min_size(1040, 760) or >>
        $model := new_model($&screen) or(err) {screen.dispose()
            >> err}
        actions := register_actions(&model, &screen) or >>
        << widgets.run_screen_actions($&screen, events, $&model, layout_action, &actions) or >>
    }
    fn worker(events chan ui.Event) {scene(events) or(err) {demo.fail(err.msg())
            << }}
    fn launch() int {$app := demo.app("Xu UI / Component Catalog", 1040, 820) or >>
        xu worker(app.event_ch)
        << app.run() or >> }
    fn main() int { << launch() or(err) {eprintln(err.msg())
            << 1}}
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    
    fn page_0(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.page = 0
        << ""
    }
    fn page_1(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.page = 1
        << ""
    }
    fn page_2(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.page = 2
        << ""
    }
    fn choose_theme(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.theme =(m.theme + 1) % 3
        m.appearance_dirty = true
        << ""
    }
    fn choose_scale(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        if m.text_scale == 1.0 {m.text_scale = 1.4} else {m.text_scale = 1.0}
        m.appearance_dirty = true
        << ""
    }
    fn choose_density(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        if m.density == 1.0 {m.density = 0.8} else {m.density = 1.0}
        m.appearance_dirty = true
        << ""
    }
    fn refresh_table(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.fill_table(screen) or(err) { << err.msg()}
        << ""
    }
    fn open_popover(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.open(m.popover) or(err) { << err.msg()}
        << ""
    }
    fn open_modal(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.open(m.modal) or(err) { << err.msg()}
        << ""
    }
    fn notify_theme(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        _ := screen.notify("All components share the same theme.") or(err) { << err.msg()}
        << ""
    }
    fn complete_modal(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.close_overlay(m.modal) or(err) { << err.msg()}
        _ := screen.notify("Action completed.") or(err) { << err.msg()}
        << ""
    }
    fn close_modal(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.close_overlay(m.modal) or(err) { << err.msg()}
        << ""
    }
    fn changed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.set_text(m.note, "Value changed · Tab / Shift+Tab · Escape") or(err) { << err.msg()}
        << ""
    }
    fn page_changed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.fill_table(screen) or(err) { << err.msg()}
        << changed(m, screen, action)
    }
    fn inputs_changed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        value := screen.text_value(m.combo) or(err) { << err.msg()}
        count :=(screen.values(m.multi) or(err) { << err.msg()}).len
        screen.set_text(m.value_label, "Value: " + value + "    Selected tags: " + str(count)) or(err) { << err.msg()}
        << changed(m, screen, action)
    }
    fn global_key(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        if action.kind == widgets.ACTION_KEY && int(action.value) == ui.KEY_ESCAPE{screen.close() or(err) { << err.msg()}}
        << ""
    }
    fn register_actions(m &Model, screen &widgets.Screen) widgets.ActionDispatcher#Model, widgets.Screen, widgets.Action{
        $d := widgets.action_dispatcher(m, screen)
        d.on(m.nav[0], widgets.ACTION_ACTIVATE, page_0) or >>
        d.on(m.nav[1], widgets.ACTION_ACTIVATE, page_1) or >>
        d.on(m.nav[2], widgets.ACTION_ACTIVATE, page_2) or >>
        d.on(m.settings[0], widgets.ACTION_ACTIVATE, choose_theme) or >>
        d.on(m.settings[1], widgets.ACTION_ACTIVATE, choose_scale) or >>
        d.on(m.settings[2], widgets.ACTION_ACTIVATE, choose_density) or >>
        d.on(m.table, widgets.ACTION_ACTIVATE, refresh_table) or >>
        d.on(m.overlay_buttons[0], widgets.ACTION_ACTIVATE, open_popover) or >>
        d.on(m.overlay_buttons[1], widgets.ACTION_ACTIVATE, open_modal) or >>
        d.on(m.overlay_buttons[2], widgets.ACTION_ACTIVATE, notify_theme) or >>
        d.on(m.modal_actions[0], widgets.ACTION_ACTIVATE, complete_modal) or >>
        d.on(m.modal_actions[1], widgets.ACTION_ACTIVATE, close_modal) or >>
        for id in[m.table, m.tree, m.crumbs, m.color] {d.on(id, widgets.ACTION_CHANGE, changed) or >> }
        d.on(m.pager, widgets.ACTION_CHANGE, page_changed) or >>
        d.on(m.combo, widgets.ACTION_CHANGE, inputs_changed) or >>
        d.on(m.multi, widgets.ACTION_CHANGE, inputs_changed) or >>
        // Screen-wide keys have id 0, outside the by-id control namespace.
        d.set_fallback(global_key)
        << d
    }
    Xustyle.xu
    @main
    
    #ui
    #ui/widgets
    
    fn layout_action(m $&Model, screen $&widgets.Screen) string {
        apply_appearance(m, screen) or(err) { << err.msg()}
        m.layout(screen) or(err) { << err.msg()}
        << ""
    }
    fn apply_appearance(m $&Model, screen $&widgets.Screen) int {
        if !m.appearance_dirty{ << 0}
        $styles := widgets.preset_styles(m.theme) or >>
        styles.text_scale = m.text_scale
        styles.density = m.density
        appearance := widgets.screen_appearance(&styles, screen.reduced_motion()) or >>
        screen.apply_appearance(&appearance) or >>
        m.appearance_dirty = false
        << 0
    }
  • 16_ui_webview/widgets/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu

    Xumain.xu
    @main
    #ui
    #ui/draw
    #ui/layout
    #ui/widgets
    demo #"github.com/xulang-org/examples/ui_demo"
    
    struct Model{
        button widgets.Button
        checkbox widgets.Checkbox
        progress widgets.Progress
        scroll widgets.Scroll
        button_label draw.TextLayout
        checkbox_label draw.TextLayout
        theme widgets.Theme
        context draw.Context
        count int
        header_id int
        button_id int
        check_id int
        progress_id int
        scroll_id int
        row_ids []int
    }
    fn (model $&Model) button_input(kind int, input &ui.InputEvent) widgets.Action{
        button := $&model.button
        << button.route(kind, input) or >>
    }
    fn (model $&Model) checkbox_input(kind int, input &ui.InputEvent) widgets.Action{
        checkbox := $&model.checkbox
        << checkbox.route(kind, input) or >>
    }
    fn (model $&Model) scroll_input(kind int, input &ui.InputEvent) widgets.Action{
        scroll := $&model.scroll
        << scroll.route(kind, input) or >>
    }
    fn (model $&Model) input(id int, kind int, input &ui.InputEvent) widgets.Action{
        if id == model.button_id{ << model.button_input(kind, input) or >> }
        if id == model.check_id{ << model.checkbox_input(kind, input) or >> }
        if id == model.scroll_id{ << model.scroll_input(kind, input) or >> }
        << widgets.Action{kind: widgets.ACTION_NONE, id: id, needs_paint: false, request_focus: false, consumed: false, value: 0.0}
    }
    fn (model $&Model) place_button(bounds &layout.Rect) int {
        button := $&model.button
        << button.set_bounds(bounds) or >>
    }
    fn (model $&Model) place_checkbox(bounds &layout.Rect) int {
        checkbox := $&model.checkbox
        << checkbox.set_bounds(bounds) or >>
    }
    fn (model $&Model) place_progress(bounds &layout.Rect) int {
        progress := $&model.progress
        << progress.set_bounds(bounds) or >>
    }
    fn (model $&Model) paint(id int, bounds &layout.Rect, frame $&draw.Frame) bool {
        model.draw_node(id, bounds, frame) or(err) {eprintln(err.msg())
            << false}
        << true
    }
    fn (model $&Model) draw_node(id int, bounds &layout.Rect, frame $&draw.Frame) int {
        if id == model.header_id{
            demo.text(&model.context, frame, 0.0, 0.0, 14.0, demo.accent(), "03 / RETAINED LAYOUT + CONTROLS") or >>
            demo.text(&model.context, frame, 0.0, 28.0, 24.0, demo.ink(), "Actions completed: " + str(model.count)) or >>
        } else if id == model.button_id{
            model.place_button(bounds) or >>
            model.button.paint(frame, &model.button_label, &model.theme) or >>
        } else if id == model.check_id{
            model.place_checkbox(bounds) or >>
            model.checkbox.paint(frame, &model.checkbox_label, &model.theme) or >>
        } else if id == model.progress_id{
            model.place_progress(bounds) or >>
            model.progress.paint(frame, &model.theme) or >>
        } else if id == model.scroll_id{
            scroll := $&model.scroll
            scroll.set_bounds(bounds) or >>
            frame.fill_rect(0.0, 0.0, bounds.width, bounds.height, draw.rgb(26, 37, 50)) or >>
        } else {
            for i in 0:model.row_ids.len{
                if id == model.row_ids[i] {demo.text(&model.context, frame, 12.0, 5.0, 15.0, demo.muted(), "Retained row " + str(i + 1) + " / scroll, Tab, PageDown, Home") or >> }
            }
        }
        << 0
    }
    fn (model $&Model) advance() int {
        model.count = model.count + 1
        println("Action count: " + str(model.count))
        value := f64(model.count % 11) / 10.0
        progress := $&model.progress
        << progress.set_value(value) or >>
    }
    fn (model $&Model) enable_button(enabled bool) {
        button := $&model.button
        button.set_enabled(enabled)
    }
    fn (model $&Model) acknowledge_button() {
        control := $&model.button
        control.painted()
    }
    fn (model $&Model) acknowledge_checkbox() {
        control := $&model.checkbox
        control.painted()
    }
    fn (model $&Model) acknowledge_progress() {
        control := $&model.progress
        control.painted()
    }
    fn (model $&Model) acknowledge_scroll() {
        control := $&model.scroll
        control.painted()
    }
    fn (model $&Model) acknowledge() {
        model.acknowledge_button()
        model.acknowledge_checkbox()
        model.acknowledge_progress()
        model.acknowledge_scroll()
    }
    fn scene(ech chan ui.Event) int {
        ready := demo.ready(ech) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        identity := ui.canvas_of(&ready) or >>
        context := draw.context_of(&ready) or >>
        host := widgets.Host{context: context, identity: identity}
        $column := layout.box_style(layout.BOX_COLUMN)
        column.padding = layout.insets(28.0) or >>
        column.gap = 14.0
        column.cross_alignment = layout.CROSS_STRETCH
        $view := host.view(&column, demo.background()) or >>
        leaf := layout.box_style(layout.BOX_LEAF)
        header := view.add(view.root(), &leaf, &layout.Size{width: 400.0, height: 72.0}) or >>
        button_id := view.add(view.root(), &leaf, &layout.Size{width: 280.0, height: 44.0}) or >>
        check_id := view.add(view.root(), &leaf, &layout.Size{width: 280.0, height: 40.0}) or >>
        progress_id := view.add(view.root(), &leaf, &layout.Size{width: 280.0, height: 12.0}) or >>
        $viewport := layout.box_style(layout.BOX_COLUMN)
        viewport.height = 220.0
        viewport.clip = true
        viewport.cross_alignment = layout.CROSS_STRETCH
        viewport.gap = 6.0
        scroll_id := view.add(view.root(), &viewport, &layout.Size{width: 400.0, height: 220.0}) or >>
        $rows :=[]int {}
        for _ in 0:20 {
            row := view.add(scroll_id, &leaf, &layout.Size{width: 400.0, height: 32.0}) or >>
            rows.push(row)
            view.set_boundary(row, true) or >>
        }
        for id in[header, button_id, check_id, progress_id, scroll_id] {view.set_boundary(id, true) or >> }
        for id in[button_id, check_id, scroll_id] {view.set_input(id, true, true) or >> }
        empty := layout.Rect{x: 0.0, y: 0.0, width: 0.0, height: 0.0}
        options := draw.text_options(15.0)
        first := "Complete one action"
        second := "Enable action button"
        $model := Model{button: widgets.button(&identity, button_id, &empty) or >>,
            checkbox: widgets.checkbox(&identity, check_id, &empty, true) or >>,
            progress: widgets.progress(&empty, 0.0) or >>,
            scroll: widgets.scroll(&identity, scroll_id, &empty, widgets.AXIS_VERTICAL, 760.0) or >>,
            button_label: context.layout_text(&first, &options) or >>,
            checkbox_label: context.layout_text(&second, &options) or >>,
            theme: widgets.default_theme(), context: context, count: 0, header_id: header, button_id: button_id, check_id: check_id, progress_id: progress_id, scroll_id: scroll_id, row_ids: rows}
        dispatcher := register_actions(&model, &view) or >>
        $width := 700.0
        $height := 600.0
        while true {
            constraints := layout.tight(width, height) or >>
            submitted := widgets.present($&view, &constraints, $&model) or >>
            if submitted{model.acknowledge()}
            event := demo.next(ech)
            if event.kind == ui.EV_EXIT{ <- }
            if event.window_id != identity.window_id{ -> }
            if event.kind == ui.EV_CANVAS_METRICS{
                metrics := ui.metrics_of(&event) or >>
                if metrics.width > 0.0 && metrics.height > 0.0 {width = metrics.width
                    height = metrics.height}
            }
            actions := widgets.dispatch_event($&view, &event, $&model) or >>
            for action in actions{_ := dispatcher.dispatch(&action, $&model, $&view) or >> }
            if event.kind == ui.EV_CANVAS_CLOSED{ <- }
            if ui.is_input_event(event.kind) {
                input := ui.input_of(&event) or >>
                if input.kind == ui.EV_KEY_DOWN && input.key == ui.KEY_ESCAPE{demo.quit() or >> }
            }
            stats := view.stats()
            if stats.recorded_boundaries > 0 || stats.reused_boundaries > 0 {
                println("View: " + str(stats.recorded_boundaries) + " recorded / " + str(stats.reused_boundaries) + " reused boundaries")
            }
        }
        view.dispose()
        // Native close revokes resources; only release user handles while live.
        if demo.alive(&identity) {
            label := $&model.button_label
            label.dispose() or >>
            check_label := $&model.checkbox_label
            check_label.dispose() or >>
        }
        << 0
    }
    fn worker(ech chan ui.Event) {scene(ech) or(err) {demo.fail(err.msg())
            << }}
    fn launch() int {
        $app := demo.app("Xu UI / Retained Controls", 700, 600) or >>
        xu worker(app.event_ch)
        << app.run() or >>
    }
    fn main() int { << launch() or(err) {eprintln(err.msg())
            << 1}}
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    
    fn activate(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        m.advance() or(err) { << err.msg()}
        screen.mark_paint(m.header_id) or(err) { << err.msg()}
        screen.mark_paint(m.progress_id) or(err) { << err.msg()}
        << ""
    }
    fn enable(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        enabled := m.checkbox.value()
        m.enable_button(enabled)
        screen.set_input(m.button_id, enabled, enabled) or(err) { << err.msg()}
        screen.mark_paint(m.button_id) or(err) { << err.msg()}
        << ""
    }
    fn scroll(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        screen.set_scroll(m.scroll_id, 0.0, action.value) or(err) { << err.msg()}
        << ""
    }
    fn register_actions(m &Model, screen &widgets.View) widgets.ActionDispatcher#Model, widgets.View, widgets.Action{
        $d := widgets.action_dispatcher(m, screen)
        d.on(m.button_id, widgets.ACTION_ACTIVATE, activate) or >>
        d.on(m.check_id, widgets.ACTION_CHANGE, enable) or >>
        d.on(m.scroll_id, widgets.ACTION_SCROLL, scroll) or >>
        << d
    }
  • 16_ui_webview/interaction_gallery/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu · style.xu

    Xumain.xu
    @main
    
    #ui
    #ui/widgets
    #ui/layout
    #time
    #math
    #errors
    demo #"github.com/xulang-org/examples/ui_demo"
    
    struct Model{
        tree int
        name int
        search int
        task int
        cancel int
        table int
        theme int
        guides int
        density int
        effects int
        failure int
        message int
        headings []int
        controls_page int
        work_group int
        basic_group int
        extras []int
        show_controls bool
        theme_index int
        guided bool
        compact bool
        reduced bool
        fail_next bool
        appearance_dirty bool
        task_id int
        completed int
        running bool
        checksum int
        next_work time.Instant
    }
    fn make_model(screen $&widgets.Screen) Model{
        $name_decoration := widgets.field_decoration(&"Output name")
        name_decoration.helper = "A persistent label, native text selection and IME"
        name_decoration.error = "Enter an output name before building."
        name_decoration.clearable = true
        name := screen.field("", &name_decoration) or >>
        $search_decoration := widgets.field_decoration(&"Find a component")
        search_decoration.helper = "Matching nodes keep their ancestor path"
        search_decoration.clearable = true
        search := screen.field("", &search_decoration) or >>
        tree := screen.tree() or >>
        root := screen.tree_add(tree, - 1, "xu-workbench") or >>
        src := screen.tree_add(tree, root, "src") or >>
        entry := screen.tree_add(tree, src, "main.xu") or >>
        controls := screen.tree_add(tree, src, "widgets") or >>
        for label in["tree_view.xu", "task_button.xu", "field.xu", "table.xu"] {
            node := screen.tree_add(tree, controls, label) or >>
            screen.set_tree_action(tree, node, true) or >>
        }
        manifest := screen.tree_add(tree, root, "xu.xun") or >>
        screen.set_tree_metadata(tree, entry, "entry") or >>
        screen.set_tree_metadata(tree, manifest, "module") or >>
        for node in[root, src, controls] {screen.set_expanded(tree, node, true) or >> }
        task := screen.task_button("Build project") or >>
        screen.set_task_labels(task, "Building", "Built · run again", "Retry build", "Build again") or >>
        table := screen.table(&["Component", "Experience", "Status"], 18, 0) or >>
        screen.set_table_column(table, 0, 144.0, 0.0) or >>
        screen.set_table_column(table, 1, 340.0, 0.0) or >>
        screen.set_table_column(table, 2, 128.0, 0.0) or >>
        names :=["TreeView", "TaskButton", "Field", "Table", "Select", "Popover"]
        details :=["Find and reveal", "Real task progress", "Floating label / native IME", "Resizable columns", "Keyboard choices", "Anchored feedback"]
        for row in 0:18 {
            index := row % 6
            screen.set_cell(table, row, 0, names[index]) or >>
            screen.set_cell(table, row, 1, details[index]) or >>
            screen.set_cell(table, row, 2, "Ready") or >>
        }
        headings :=[screen.label("XUUI / INTERACTION LAB", 12.0, true) or >>,
        screen.label("Precision in every interaction.", 25.0, false) or >>,
        screen.label("WORKSPACE", 12.0, true) or >>, screen.label("BUILD CONFIGURATION", 12.0, true) or >>,
        screen.label("COMPONENTS / scroll, select and sort", 12.0, true) or >>]
        work_group := screen.group() or >>
        basic_group := screen.group() or >>
        for id in[tree, name, search, task, table, headings[2], headings[3], headings[4]] {screen.set_parent(id, work_group) or >> }
        extras := extra_controls(screen) or >>
        for id in extras{screen.set_parent(id, basic_group) or >> }
        cancel := screen.button("Cancel task") or >>
        screen.set_parent(cancel, work_group) or >>
        controls_page := screen.button("All controls") or >>
        styles := screen.styles()
        primary_style := styles.button_variant(widgets.BUTTON_PRIMARY) or >>
        screen.set_control_style(task, &primary_style) or >>
        << Model{tree: tree, name: name, search: search, task: task, cancel: cancel,
            table: table, theme: screen.button("Theme") or >>, guides: screen.button("Tree guides") or >>,
            density: screen.button("Density") or >>, effects: screen.button("Motion") or >>, failure: screen.button("Fail next build") or >>,
            message: screen.label("Local work batches report completed items. No simulated percentage clock.", 13.0, true) or >>,
            headings: headings, controls_page: controls_page, work_group: work_group, basic_group: basic_group, extras: extras, show_controls: false, theme_index: 1, guided: false, compact: false, reduced: false, fail_next: false, appearance_dirty: true,
            task_id: 0, completed: 0, running: false, checksum: 0, next_work: time.zero_instant()}
    }
    fn (m &Model) layout(screen $&widgets.Screen) int {
        width := screen.width()
        height := screen.height()
        left := 310.0
        screen.place(m.headings[0], 28.0, 24.0, width - 56.0, 22.0) or >>
        screen.place(m.headings[1], 28.0, 54.0, width - 56.0, 36.0) or >>
        buttons :=[m.theme, m.guides, m.density, m.effects, m.failure, m.controls_page]
        for i in 0:buttons.len{screen.place(buttons[i], 28.0 + f64(i) * 144.0, 111.0, 132.0, 36.0) or >> }
        screen.set_visible(m.work_group, !m.show_controls) or >>
        screen.set_visible(m.basic_group, m.show_controls) or >>
        screen.set_selected_button(m.controls_page, m.show_controls) or >>
        extra_layout(screen, &m.extras) or >>
        screen.set_selected_button(m.guides, m.guided) or >>
        screen.set_selected_button(m.effects, m.reduced) or >>
        screen.set_selected_button(m.failure, m.fail_next) or >>
        screen.place(m.headings[2], 28.0, 173.0, left - 24.0, 24.0) or >>
        screen.place(m.search, 28.0, 208.0, left - 24.0, 80.0) or >>
        screen.place(m.tree, 28.0, 302.0, left - 24.0, height - 352.0) or >>
        x := left + 36.0
        right_width := width - x - 28.0
        screen.place(m.headings[3], x, 173.0, right_width, 24.0) or >>
        screen.place(m.name, x, 208.0, right_width, 86.0) or >>
        screen.place(m.task, x, 307.0, 230.0, 40.0) or >>
        screen.place(m.cancel, x + 246.0, 307.0, 136.0, 40.0) or >>
        screen.set_enabled(m.cancel, m.running) or >>
        screen.place(m.headings[4], x, 377.0, right_width, 24.0) or >>
        screen.place(m.table, x, 413.0, right_width, height - 493.0) or >>
        screen.place(m.message, 28.0, height - 41.0, width - 56.0, 24.0) or >>
        << 0
    }
    fn (m $&Model) work(screen $&widgets.Screen, now time.Instant) int {
        if !m.running || now.before(m.next_work) { << 0}
        // Each progress update follows an actual bounded work batch. The pause
        // represents an application work queue and never changes the percentage.
        for i in 0:5000 {m.checksum =(m.checksum + i *(m.completed + 1)) % 1000003}
        m.completed = m.completed + 1
        _ := screen.set_task_progress(m.task, m.task_id, f64(m.completed) / 48.0) or >>
        m.next_work = now.add(time.milliseconds(35) or >>) or >>
        if m.fail_next && m.completed == 18 {
            _ := screen.complete_task(m.task, m.task_id, widgets.TASK_ERROR) or >>
            m.running = false
            m.fail_next = false
            screen.set_text(m.message, "Example failure. Retry starts a new task; stale progress is rejected.") or >>
        } else if m.completed == 48 {
            _ := screen.complete_task(m.task, m.task_id, widgets.TASK_SUCCESS) or >>
            m.running = false
            screen.set_text(m.message, "48/48 work batches completed · checksum " + str(m.checksum)) or >>
        }
        << 0
    }
    fn extra_controls(screen $&widgets.Screen)[]int {
        $ids :=[]int {}
        ids.push(screen.card() or >>)
        ids.push(screen.label("CONTROLS / keyboard, pointer and state", 12.0, true) or >>)
        ids.push(screen.checkbox("Keep generated files", true) or >>)
        ids.push(screen.switch_control("Live preview", true) or >>)
        ids.push(screen.radio("Use workspace settings", 1, true) or >>)
        ids.push(screen.slider(0.0, 100.0, 40.0) or >>)
        ids.push(screen.stepper(1.0, 16.0, 1.0, 4.0) or >>)
        ids.push(screen.tabs(&["Files", "History", "Output"], 0) or >>)
        ids.push(screen.segmented(&["Desktop", "Tablet", "Phone"], 0) or >>)
        ids.push(screen.select_box(&["Xu source", "Configuration", "Plain text"], 0) or >>)
        ids.push(screen.list_box(&["Compiler", "Widgets", "Runtime", "Desktop", "Examples", "Tooling"], 0) or >>)
        ids.push(screen.progress(0.62) or >>)
        ids.push(screen.badge("Ready") or >>)
        ids.push(screen.divider(widgets.AXIS_HORIZONTAL) or >>)
        ids.push(screen.radio_group(&["Use local build", "Use cached build", "Build dependencies"], 0) or >>)
        ids.push(screen.input("Native input · 中文") or >>)
        ids.push(screen.text_area("A multi-line editor.\nSelection, clipboard and native IME remain available.") or >>)
        ids.push(screen.date_picker(time.date(2026, 10, 25, 10, 30, 0, 0)) or >>)
        ids.push(screen.time_picker(time.date(2026, 10, 25, 10, 30, 0, 0)) or >>)
        ids.push(screen.button("Queue notification") or >>)
        _ := screen.tooltip(ids[19], "Repeated notifications queue; hover or focus pauses expiry.") or >>
        screen.set_slider_commit_only(ids[5], true) or >>
        screen.set_checkbox_indeterminate(ids[2], true) or >>
        screen.set_select_option_enabled(ids[9], 2, false) or >>
        screen.set_badge_tone(ids[12], widgets.BADGE_SUCCESS) or >>
        screen.set_progress_buffer(ids[11], 0.84) or >>
        screen.set_date_options(ids[17], time.date(2026, 10, 25, 0, 0, 0, 0), true) or >>
        screen.set_clock_format(ids[18], true, true) or >>
        << ids
    }
    fn extra_layout(screen $&widgets.Screen, ids &[]int) int {
        gap := 28.0
        width :=(screen.width() - 84.0) * 0.5
        right := 56.0 + width
        screen.place(ids[0], gap, 628.0, width, 112.0) or >>
        screen.place(ids[1], gap, 173.0, screen.width() - 56.0, 24.0) or >>
        for i in 2:5 {screen.place(ids[i], gap, 211.0 + f64(i - 2) * 46.0, width, 36.0) or >> }
        screen.place(ids[5], gap, 357.0, width - 136.0, 36.0) or >>
        screen.place(ids[6], gap + width - 124.0, 357.0, 124.0, 36.0) or >>
        screen.place(ids[7], gap, 412.0, width, 36.0) or >>
        screen.place(ids[8], gap, 466.0, width, 36.0) or >>
        screen.place(ids[11], gap, 522.0, width - 120.0, 12.0) or >>
        screen.place(ids[12], gap + width - 100.0, 510.0, 100.0, 32.0) or >>
        screen.place(ids[13], gap, 607.0, width, 1.0) or >>
        screen.place(ids[14], right, 211.0, width, 126.0) or >>
        screen.place(ids[9], right, 357.0, width, 36.0) or >>
        screen.place(ids[10], right, 412.0, width, 158.0) or >>
        screen.place(ids[15], right, 590.0, width, 36.0) or >>
        screen.place(ids[16], right, 644.0, width, 96.0) or >>
        screen.place(ids[17], gap, 560.0,(width - 16.0) * 0.5, 36.0) or >>
        screen.place(ids[18], gap +(width + 16.0) * 0.5, 560.0,(width - 16.0) * 0.5, 36.0) or >>
        screen.place(ids[19], gap + 16.0, 665.0, width - 32.0, 38.0) or >>
        << 0
    }
    fn next_event(events chan ui.Event, deadline time.Instant) ui.Event{
        if deadline.is_zero() { << <- events}
        delay := deadline.since(time.instant())
        if delay.nanoseconds() <= 0 { << ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}}
        timer := delay.timer()
        select {
            event := <- events{timer.stop()
                << event}
            _ := <- timer.c{timer.stop()}
        }
        << ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}
    }
    fn scene(events chan ui.Event) int {
        ready := demo.ready(events) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        $screen := widgets.screen(&ready) or >>
        screen.resize(1000.0, 820.0) or >>
        screen.set_min_size(900, 720) or >>
        $model := make_model($&screen) or(err) {screen.dispose()
            >> err}
        apply_appearance($&model, $&screen) or >>
        model.layout($&screen) or >>
        _ := screen.render() or >>
        $dispatcher := register_actions(&model, &screen) or >>
        while screen.is_open() {
            now := time.instant()
            apply_appearance($&model, $&screen) or >>
            register_notices(&screen, $&dispatcher) or >>
            model.work($&screen, now) or >>
            model.layout($&screen) or >>
            $deadline := screen.advance(now) or(err) { >> errors.new("gallery animation: " + err.msg())}
            for action in screen.take_actions() {_ := dispatcher.dispatch(&action, $&model, $&screen) or >> }
            apply_appearance($&model, $&screen) or >>
            _ := screen.render() or(err) { >> errors.new("gallery render: " + err.msg())}
            if model.running &&(deadline.is_zero() || model.next_work.before(deadline)) {deadline = model.next_work}
            event := next_event(events, deadline) or >>
            $actions := screen.event(&event) or >>
            $count := 0
            while screen.is_open() && count < 128 {
                pending := ui.poll_chan(events)
                if pending.kind == ui.EV_NONE{ <- }
                more := screen.event(&pending) or >>
                for action in more{actions.push(action)}
                count += 1
            }
            for action in actions{_ := dispatcher.dispatch(&action, $&model, $&screen) or >> }
        }
        screen.dispose()
        << 0
    }
    fn worker(events chan ui.Event) {scene(events) or(err) {demo.fail(err.msg())
            << }}
    fn launch() int {
        $app := demo.app("XUUI / Interaction Lab", 1000, 820) or >>
        xu worker(app.event_ch)
        << app.run() or >>
    }
    fn main() int { << launch() or(err) {eprintln(err.msg())
            << 1}}
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    #time
    
    fn search_changed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        query := screen.text_value(m.search) or(err) { << err.msg()}
        screen.set_tree_filter(m.tree, query) or(err) { << err.msg()}
        << ""
    }
    fn name_changed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.set_field_invalid(m.name, false) or(err) { << err.msg()}
        << ""
    }
    fn node_action(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        _ := screen.notify("Node action · " + str(int(action.value))) or(err) { << err.msg()}
        << ""
    }
    fn slider_committed(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.set_text(m.message, "Slider committed · " + str(int(action.value))) or(err) { << err.msg()}
        << ""
    }
    fn toggle_controls(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.show_controls = !m.show_controls
        << ""
    }
    fn queue_notice(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        $notice := widgets.notice(&"Saved a local configuration")
        notice.action = "Undo"
        _ := screen.enqueue_notice(&notice) or(err) { << err.msg()}
        << ""
    }
    fn choose_theme(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.theme_index =(m.theme_index + 1) % 3
        m.appearance_dirty = true
        << ""
    }
    fn choose_guides(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.guided = !m.guided
        m.appearance_dirty = true
        << ""
    }
    fn choose_density(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.compact = !m.compact
        m.appearance_dirty = true
        << ""
    }
    fn choose_motion(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.reduced = !m.reduced
        m.appearance_dirty = true
        << ""
    }
    fn choose_failure(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        m.fail_next = !m.fail_next
        << ""
    }
    fn start_task(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        if m.running{ << ""}
        name := screen.text_value(m.name) or(err) { << err.msg()}
        if name.len == 0 {screen.set_field_invalid(m.name, true) or(err) { << err.msg()}
            screen.focus(m.name) or(err) { << err.msg()}
            << ""}
        m.task_id = m.task_id + 1
        m.completed = 0
        m.checksum = 0
        m.running = true
        m.next_work = time.instant()
        screen.begin_task(m.task, m.task_id) or(err) { << err.msg()}
        << ""
    }
    fn cancel_task(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        if !m.running{ << ""}
        _ := screen.complete_task(m.task, m.task_id, widgets.TASK_CANCELLED) or(err) { << err.msg()}
        m.running = false
        screen.set_text(m.message, "Task cancelled. Completed work remains " + str(m.completed) + "/48.") or(err) { << err.msg()}
        << ""
    }
    fn notice_action(m $&Model, screen $&widgets.Screen, action &widgets.Action) string {
        screen.set_text(m.message, "Notification action · " + str(int(action.value))) or(err) { << err.msg()}
        << ""
    }
    fn register_actions(m &Model, screen &widgets.Screen) widgets.ActionDispatcher#Model, widgets.Screen, widgets.Action{
        $d := widgets.action_dispatcher(m, screen)
        d.on(m.search, widgets.ACTION_CHANGE, search_changed) or >>
        d.on(m.name, widgets.ACTION_CHANGE, name_changed) or >>
        d.on(m.tree, widgets.ACTION_ITEM_ACTION, node_action) or >>
        d.on(m.extras[5], widgets.ACTION_COMMIT, slider_committed) or >>
        d.on(m.controls_page, widgets.ACTION_ACTIVATE, toggle_controls) or >>
        d.on(m.extras[19], widgets.ACTION_ACTIVATE, queue_notice) or >>
        d.on(m.theme, widgets.ACTION_ACTIVATE, choose_theme) or >>
        d.on(m.guides, widgets.ACTION_ACTIVATE, choose_guides) or >>
        d.on(m.density, widgets.ACTION_ACTIVATE, choose_density) or >>
        d.on(m.effects, widgets.ACTION_ACTIVATE, choose_motion) or >>
        d.on(m.failure, widgets.ACTION_ACTIVATE, choose_failure) or >>
        d.on(m.task, widgets.ACTION_ACTIVATE, start_task) or >>
        d.on(m.cancel, widgets.ACTION_ACTIVATE, cancel_task) or >>
        << d
    }
    fn register_notices(screen &widgets.Screen, d $&widgets.ActionDispatcher#Model, widgets.Screen, widgets.Action) int {
        for id in screen.notice_ids() {d.on(id, widgets.ACTION_NOTICE_ACTION, notice_action) or >> }
        << 0
    }
    Xustyle.xu
    @main
    
    #ui
    #ui/widgets
    
    fn apply_appearance(m $&Model, screen $&widgets.Screen) int {
        if !m.appearance_dirty{ << 0}
        $styles := widgets.preset_styles(m.theme_index) or >>
        if m.compact{styles.density = 0.85}
        appearance := widgets.screen_appearance(&styles, m.reduced) or >>
        screen.apply_appearance(&appearance) or >>
        primary := styles.button_variant(widgets.BUTTON_PRIMARY) or >>
        screen.set_control_style(m.task, &primary) or >>
        $tree := widgets.tree_appearance()
        tree.guides = m.guided
        screen.set_tree_appearance(m.tree, &tree) or >>
        m.appearance_dirty = false
        << 0
    }
  • 16_ui_webview/editor_workbench/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu

    Xumain.xu
    @main
    #ui
    #ui/draw
    #ui/widgets
    #ui/layout
    tokens #xuui_tokens
    demo #"github.com/xulang-org/examples/ui_demo"
    
    struct Model{
        title widgets.Editor
        body widgets.Editor
        context draw.Context
        styles widgets.Styles
        dark bool
        header int
        title_id int
        body_id int
        footer int
        changes int
        status string
    }
    fn (model $&Model) input(id int, kind int, event &ui.InputEvent) widgets.Action{
        if id == model.title_id{control := $&model.title
            << control.route(kind, event) or >> }
        if id == model.body_id{control := $&model.body
            << control.route(kind, event) or >> }
        << widgets.Action{kind: 0, id: id, needs_paint: false, request_focus: false, consumed: false, value: 0.0}
    }
    fn (model $&Model) paint(id int, bounds &layout.Rect, frame $&draw.Frame) bool {
        model.draw_node(id, frame) or(err) {eprintln(err.msg())
            << false}
        << true
    }
    fn (model $&Model) draw_node(id int,frame $&draw.Frame) int {
        styles := model.styles.clone()
        if id == model.title_id { control := $&model.title
            control.paint_styled(frame,&styles) or >> }
        else if id == model.body_id { control := $&model.body
            control.paint_styled(frame,&styles) or >> }
        else if id == model.header {
            demo.text(&model.context,frame,0.0,0.0,24.0,tokens.text(model.dark),"Writing desk") or >>
            demo.text(&model.context,frame,0.0,34.0,14.0,tokens.muted(model.dark),"XUUI design standard · native text and menu controls") or >>
            demo.text(&model.context,frame,0.0,62.0,14.0,tokens.muted(model.dark),"Tab / Shift+Tab · drag selection · copy / cut / paste · arrows / Home / End") or >>
        } else if id == model.footer {
            demo.text(&model.context,frame,0.0,0.0,14.0,tokens.brand(model.dark),"Changes: " + str(model.changes) + "  |  " + model.status) or >>
            demo.text(&model.context,frame,0.0,27.0,14.0,tokens.muted(model.dark),"Use the Document menu: toggle editing, reset, query screens. Escape quits.") or >>
        }
        << 0
    }
    fn (model $&Model) place(view $&widgets.View) int {
        title := $&model.title
        widgets.place_editor(view, title) or >>
        body := $&model.body
        widgets.place_editor(view, body) or >>
        << 0
    }
    fn (model $&Model) native_event(event &ui.Event) bool {
        title := $&model.title
        first := title.event(event) or >>
        body := $&model.body
        second := body.event(event) or >>
        << first.kind == widgets.ACTION_CHANGE || second.kind == widgets.ACTION_CHANGE
    }
    fn (model $&Model) editing(on bool) int {
        title := $&model.title
        title.enable(on) or >>
        body := $&model.body
        body.enable(on) or >>
        << 0
    }
    fn (model $&Model) reset() int {
        title := $&model.title
        title.set_value(&"Untitled note") or >>
        body := $&model.body
        body.set_value(&"Write here.\n你好,Xu。\n\nSelection and IME are native; layout and painting stay in the retained View.") or >>
        << 0
    }
    fn menus(window &ui.Window,enabled bool,dark bool) int {
        $entries := [ui.submenu("document","Document",-1)]
        $reset := ui.menu_action("reset","Reset note",0)
        reset.key = 82
        reset.modifiers = ui.MENU_PRIMARY | ui.MOD_SHIFT
        entries.push(reset)
        entries.push(ui.menu_check("editing","Enable editing",0,enabled))
        entries.push(ui.menu_separator(0))
        entries.push(ui.submenu("display","Displays",0))
        $query := ui.menu_action("screens","Query current screens",4)
        query.key = 68
        query.modifiers = ui.MENU_PRIMARY | ui.MOD_SHIFT
        entries.push(query)
        $unavailable := ui.menu_action("unavailable","Unavailable action",4)
        unavailable.enabled = false
        entries.push(unavailable)
        entries.push(ui.menu_check("dark-theme","Dark appearance",0,dark))
        << window.set_menu_entries(entries) or >>
    }
    fn scene(ech chan ui.Event) int {
        ready := demo.ready(ech) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        identity := ui.canvas_of(&ready) or >>
        context := draw.context_of(&ready) or >>
        window := ui.Window{id: identity.window_id, generation: identity.generation, title: "", width: 0, height: 0, content_kind: ui.CONTENT_DRAW, content_backend_id: identity.canvas_id, closed: 0}
        menus(&window, true, false) or >>
        host := widgets.Host{context: context, identity: identity}
        $column := layout.box_style(layout.BOX_COLUMN)
        column.padding = layout.insets(24.0) or >>
        column.gap = 16.0
        column.cross_alignment = layout.CROSS_STRETCH
        $view := host.view(&column, tokens.canvas(false)) or >>
        leaf := layout.box_style(layout.BOX_LEAF)
        header := view.add(view.root(), &leaf, &layout.Size{width: 500.0, height: 88.0}) or >>
        title_id := view.add(view.root(), &leaf, &layout.Size{width: 500.0, height: 44.0}) or >>
        body_id := view.add(view.root(), &leaf, &layout.Size{width: 500.0, height: 260.0}) or >>
        footer := view.add(view.root(), &leaf, &layout.Size{width: 500.0, height: 72.0}) or >>
        for id in[header, title_id, body_id, footer] {view.set_boundary(id, true) or >> }
        for id in[title_id, body_id] {view.set_input(id, true, true) or >> }
        empty := layout.Rect{x: 0.0, y: 0.0, width: 0.0, height: 0.0}
        $model := Model{title: widgets.input(&context, &identity, title_id, &empty, &"Untitled note") or >>,
            body: widgets.text_area(&context, &identity, body_id, &empty, &"Write here.\n你好,Xu。\n\nSelection and IME are native; layout and painting stay in the retained View.") or >>,
            context: context, styles: tokens.editor_styles(false), dark: false, header: header, title_id: title_id, body_id: body_id, footer: footer, changes: 0, status: "Ready"}
        $dispatcher := widgets.action_dispatcher(&model, &view)
        dispatcher.on(title_id, widgets.ACTION_SUBMIT, submit_title) or >>
        $width := 820.0
        $height := 620.0
        $enabled := true
        options := ui.RequestOptions{timeout_ms: 5000}
        $screens := window.screens_async(&options) or >>
        $event := ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}
        // Native text snapshots already carry the latest revision. Drain queued
        // edits before painting so a key burst cannot fill the frame queue.
        while true {
            if event.kind == ui.EV_NONE{
                constraints := layout.tight(width, height) or >>
                _ := view.layout(&constraints) or >>
                model.place($&view) or >>
                submitted := widgets.present($&view, &constraints, $&model) or >>
                if submitted{
                    first := $&model.title
                    first.painted()
                    second := $&model.body
                    second.painted()
                }
                event = demo.next(ech)
            }
            if event.kind == ui.EV_EXIT{ <- }
            if event.window_id != identity.window_id{event = ui.poll_chan(ech)
                -> }
            if event.kind == ui.EV_CANVAS_METRICS{metrics := ui.metrics_of(&event) or >>
                width = metrics.width
                height = metrics.height}
            actions := widgets.dispatch_event($&view, &event, $&model) or >>
            if model.native_event(&event) or >> {model.changes = model.changes + 1
                view.mark_paint(footer) or >> }
            for action in actions{_ := dispatcher.dispatch(&action, $&model, $&view) or >> }
            if event.kind == ui.EV_MENU_CLICKED{
                if event.menu_id == "reset" {model.reset() or >> }
                if event.menu_id == "editing" {enabled = !enabled
                    model.editing(enabled) or >>
                    for id in[title_id, body_id] {view.set_input(id, enabled, enabled) or >> }
                    menus(&window, enabled, model.dark) or >> }
                if event.menu_id == "dark-theme" {
                    model.dark = !model.dark
                    model.styles = tokens.editor_styles(model.dark)
                    view.set_background(tokens.canvas(model.dark))
                    for id in [header,title_id,body_id,footer] { view.mark_paint(id) or >> }
                    menus(&window,enabled,model.dark) or >>
                }
                if event.menu_id == "screens" {screens.cancel()
                    screens = window.screens_async(&options) or >> }
            }
            if event.kind == ui.EV_REQUEST{result := ui.request_of(&event) or >>
                if result.matches(&screens) && result.status == ui.REQUEST_COMPLETED{
                    displays := ui.screen_result(&result) or >>
                    model.status = str(displays.len) + " display(s)"
                    for display in displays{println("Screen: " + display.name + " / " + str(int(display.bounds.width)) + " x " + str(int(display.bounds.height)) + " / scale " + str(int(display.scale_x)))
                        if display.current{model.status = display.name + " · " + str(int(display.bounds.width)) + " x " + str(int(display.bounds.height))}}
                    view.mark_paint(footer) or >>
                }
            }
            if event.kind == ui.EV_CANVAS_CLOSED || event.kind == ui.EV_CLOSED{ <- }
            if ui.is_input_event(event.kind) {input := ui.input_of(&event) or >>
                if input.kind == ui.EV_KEY_DOWN && input.key == ui.KEY_ESCAPE{demo.quit() or >> }}
            event = ui.poll_chan(ech)
        }
        screens.cancel()
        view.dispose()
        << 0
    }
    fn worker(ech chan ui.Event) {scene(ech) or(err) {demo.fail(err.msg())
            << }}
    fn main() int {
        $app := demo.app("Xu UI / Writing Desk", 820, 620) or(err) {eprintln(err.msg())
            << 1}
        xu worker(app.event_ch)
        << app.run() or(err) {eprintln(err.msg())
            << 1}
    }
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    
    fn submit_title(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        m.status = "Title submitted: " + m.title.value()
        screen.mark_paint(m.footer) or(err) { << err.msg()}
        << ""
    }
  • 16_ui_webview/workbench/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu

    Xumain.xu
    @main
    #ui
    #ui/draw
    #ui/layout
    #ui/widgets
    #math
    demo #"github.com/xulang-org/examples/ui_demo"
    
    struct Model{
        button widgets.Button
        checkbox widgets.Checkbox
        progress widgets.Progress
        scroll widgets.Scroll
        button_label draw.TextLayout
        checkbox_label draw.TextLayout
        theme widgets.Theme
        context draw.Context
        count int
        message string
        source string
        images []draw.Image
        header_id int
        button_id int
        check_id int
        progress_id int
        scroll_id int
        row_ids []int
        identity ui.CanvasEvent
        pending ui.Request
    }
    fn (model $&Model) button_input(kind int, input &ui.InputEvent) widgets.Action{
        button := $&model.button
        << button.route(kind, input) or >>
    }
    fn (model $&Model) checkbox_input(kind int, input &ui.InputEvent) widgets.Action{
        checkbox := $&model.checkbox
        << checkbox.route(kind, input) or >>
    }
    fn (model $&Model) scroll_input(kind int, input &ui.InputEvent) widgets.Action{
        scroll := $&model.scroll
        << scroll.route(kind, input) or >>
    }
    fn (model $&Model) input(id int, kind int, input &ui.InputEvent) widgets.Action{
        if id == model.button_id{ << model.button_input(kind, input) or >> }
        if id == model.check_id{ << model.checkbox_input(kind, input) or >> }
        if id == model.scroll_id{ << model.scroll_input(kind, input) or >> }
        << widgets.Action{kind: widgets.ACTION_NONE, id: id, needs_paint: false, request_focus: false, consumed: false, value: 0.0}
    }
    fn (model $&Model) place_button(bounds &layout.Rect) int {
        button := $&model.button
        << button.set_bounds(bounds) or >>
    }
    fn (model $&Model) place_checkbox(bounds &layout.Rect) int {
        checkbox := $&model.checkbox
        << checkbox.set_bounds(bounds) or >>
    }
    fn (model $&Model) place_progress(bounds &layout.Rect) int {
        progress := $&model.progress
        << progress.set_bounds(bounds) or >>
    }
    fn (model $&Model) paint(id int, bounds &layout.Rect, frame $&draw.Frame) bool {
        model.draw_node(id, bounds, frame) or(err) {eprintln(err.msg())
            << false}
        << true
    }
    fn (model $&Model) draw_node(id int, bounds &layout.Rect, frame $&draw.Frame) int {
        if id == model.header_id{
            demo.text(&model.context, frame, 0.0, 0.0, 14.0, demo.accent(), "07 / IMAGE WORKBENCH") or >>
            demo.text(&model.context, frame, 0.0, 28.0, 24.0, demo.ink(), "Image workbench") or >>
            demo.text(&model.context, frame, 0.0, 58.0, 13.0, demo.muted(), model.message + "") or >>
        } else if id == model.button_id{
            model.place_button(bounds) or >>
            model.button.paint(frame, &model.button_label, &model.theme) or >>
        } else if id == model.check_id{
            model.place_checkbox(bounds) or >>
            model.checkbox.paint(frame, &model.checkbox_label, &model.theme) or >>
        } else if id == model.progress_id{
            model.place_progress(bounds) or >>
            model.progress.paint(frame, &model.theme) or >>
        } else if id == model.scroll_id{
            scroll := $&model.scroll
            scroll.set_bounds(bounds) or >>
            frame.fill_rect(0.0, 0.0, bounds.width, bounds.height, draw.rgb(26, 37, 50)) or >>
        } else if model.row_ids.len > 0 && id == model.row_ids[0] {
            if model.images.len > 0 {
                image := model.images[0]
                scale := math.min(bounds.width / f64(image.width), bounds.height / f64(image.height))
                frame.image(&image, 0.0, 0.0, f64(image.width) * scale, f64(image.height) * scale) or >>
            } else {demo.text(&model.context, frame, 12.0, 20.0, 17.0, demo.muted(), "The selected image appears here.") or >> }
        }
        << 0
    }
    fn (model $&Model) progress_value(value f64) int {
        progress := $&model.progress
        << progress.set_value(value) or >>
    }
    fn (model $&Model) retire_image(index int) int {
        $image := model.images[index]
        image.dispose() or >>
        model.images[index] = image
        << 0
    }
    fn (model $&Model) replace_image(image draw.Image) int {
        for i in 0:model.images.len{model.retire_image(i) or >> }
        model.images =[]draw.Image{}
        model.images.push(image)
        << 0
    }
    fn preview_paint(window &ui.Window, path &string) int {
        context := draw.window_context(window) or >>
        $image := context.load_image(path) or >>
        $frame := context.new_frame(256)
        frame.begin() or >>
        frame.set_bg(demo.background()) or >>
        scale := math.min(f64(window.width - 40) / f64(image.width), f64(window.height - 40) / f64(image.height))
        frame.image(&image, 20.0, 20.0, f64(image.width) * scale, f64(image.height) * scale) or >>
        frame.present() or >>
        frame.dispose()
        image.dispose() or >>
        << 0
    }
    fn (model $&Model) acknowledge_button() {
        control := $&model.button
        control.painted()
    }
    fn (model $&Model) acknowledge_checkbox() {
        control := $&model.checkbox
        control.painted()
    }
    fn (model $&Model) acknowledge_progress() {
        control := $&model.progress
        control.painted()
    }
    fn (model $&Model) acknowledge_scroll() {
        control := $&model.scroll
        control.painted()
    }
    fn (model $&Model) acknowledge() {
        model.acknowledge_button()
        model.acknowledge_checkbox()
        model.acknowledge_progress()
        model.acknowledge_scroll()
    }
    fn scene(ech chan ui.Event) int {
        ready := demo.ready(ech) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        identity := ui.canvas_of(&ready) or >>
        context := draw.context_of(&ready) or >>
        host := widgets.Host{context: context, identity: identity}
        $column := layout.box_style(layout.BOX_COLUMN)
        column.padding = layout.insets(28.0) or >>
        column.gap = 14.0
        column.cross_alignment = layout.CROSS_STRETCH
        $view := host.view(&column, demo.background()) or >>
        leaf := layout.box_style(layout.BOX_LEAF)
        header := view.add(view.root(), &leaf, &layout.Size{width: 400.0, height: 88.0}) or >>
        button_id := view.add(view.root(), &leaf, &layout.Size{width: 280.0, height: 44.0}) or >>
        check_id := view.add(view.root(), &leaf, &layout.Size{width: 280.0, height: 40.0}) or >>
        progress_id := view.add(view.root(), &leaf, &layout.Size{width: 280.0, height: 12.0}) or >>
        $viewport := layout.box_style(layout.BOX_COLUMN)
        viewport.height = 260.0
        viewport.clip = true
        viewport.cross_alignment = layout.CROSS_STRETCH
        viewport.gap = 6.0
        scroll_id := view.add(view.root(), &viewport, &layout.Size{width: 400.0, height: 260.0}) or >>
        $rows :=[]int {}
        for _ in 0:1 {
            row := view.add(scroll_id, &leaf, &layout.Size{width: 400.0, height: 250.0}) or >>
            rows.push(row)
            view.set_boundary(row, true) or >>
        }
        for id in[header, button_id, check_id, progress_id, scroll_id] {view.set_boundary(id, true) or >> }
        for id in[button_id, check_id, scroll_id] {view.set_input(id, true, true) or >> }
        empty := layout.Rect{x: 0.0, y: 0.0, width: 0.0, height: 0.0}
        options := draw.text_options(15.0)
        first := "Open a PNG or JPEG"
        second := "Show a separate preview window"
        $model := Model{button: widgets.button(&identity, button_id, &empty) or >>,
            checkbox: widgets.checkbox(&identity, check_id, &empty, true) or >>,
            progress: widgets.progress(&empty, 0.0) or >>,
            scroll: widgets.scroll(&identity, scroll_id, &empty, widgets.AXIS_VERTICAL, 250.0) or >>,
            button_label: context.layout_text(&first, &options) or >>,
            checkbox_label: context.layout_text(&second, &options) or >>,
            theme: widgets.default_theme(), context: context, count: 0, message: "Open a local image to begin.", source: "", images:[]draw.Image{}, header_id: header, button_id: button_id, check_id: check_id, progress_id: progress_id, scroll_id: scroll_id, row_ids: rows, identity: identity, pending: ui.Request{id: 0, window_id: 0, canvas_id: 0, generation: 0, kind: 0}}
        $width := 900.0
        $height := 700.0
        $native := demo.windows(ech)
        $preview := ui.Window{id: 0, generation: 0, title: "Preview", width: 720, height: 500, content_kind: ui.CONTENT_DRAW, content_backend_id: 0, closed: 1}
        dispatcher := register_actions(&model, &view) or >>
        while true {
            constraints := layout.tight(width, height) or >>
            submitted := widgets.present($&view, &constraints, $&model) or >>
            if submitted{model.acknowledge()}
            event := demo.next(ech)
            if event.kind == ui.EV_EXIT{ <- }
            if preview.id > 0 && event.window_id == preview.id{
                if event.kind == ui.EV_CLOSED || event.kind == ui.EV_WINDOW_FAILED{preview.closed = 1}
                if event.kind == ui.EV_CANVAS_READY && model.source.len > 0 {
                    preview.content_command("input_enabled\t1") or >>
                    preview.content_command("pan_enabled\t0") or >>
                    preview_paint(&preview, &model.source) or >> }
                if event.kind == ui.EV_CANVAS_METRICS{
                    metrics := ui.metrics_of(&event) or >>
                    if metrics.width > 40.0 && metrics.height > 40.0 {preview.width = int(metrics.width)
                        preview.height = int(metrics.height)
                        if model.source.len > 0 {preview_paint(&preview, &model.source) or >> }}
                }
                ->
            }
            if event.window_id != identity.window_id{ -> }
            if event.kind == ui.EV_REQUEST{
                result := ui.request_of(&event) or >>
                if result.matches(&model.pending) {
                    model.pending.id = 0
                    model.message = "Selection cancelled or failed."
                    if result.status == ui.REQUEST_COMPLETED{
                        paths := ui.file_paths(&result) or >>
                        if paths.len > 0 {
                            path := paths[0] + ""
                            image := context.load_image(&path) or(err) {model.message = err.msg()
                                view.mark_paint(header) or >>
                                -> }
                            model.replace_image(image) or >>
                            model.source = path + ""
                            model.message = "Loaded " + str(image.width) + " x " + str(image.height) + " pixels"
                            println(model.message + "")
                            model.progress_value(1.0) or >>
                            view.mark_paint(model.row_ids[0]) or >>
                            if model.checkbox.value() {
                                if preview.closed != 0 {preview = native.open_content_window(ui.WindowOpts{title: "Xu UI / Image Preview", width: 720, height: 500}, ui.CONTENT_DRAW) or >> }
                                else {preview_paint(&preview, &path) or >>
                                    preview.focus() or >> }
                            }
                        }
                    }
                    view.mark_paint(header) or >>
                    view.mark_paint(progress_id) or >>
                }
            }
            if event.kind == ui.EV_CANVAS_METRICS{
                metrics := ui.metrics_of(&event) or >>
                if metrics.width > 0.0 && metrics.height > 0.0 {width = metrics.width
                    height = metrics.height}
            }
            actions := widgets.dispatch_event($&view, &event, $&model) or >>
            for action in actions{_ := dispatcher.dispatch(&action, $&model, $&view) or >> }
            if event.kind == ui.EV_CANVAS_CLOSED{demo.quit() or >>
                <- }
            if ui.is_input_event(event.kind) {
                input := ui.input_of(&event) or >>
                if input.kind == ui.EV_KEY_DOWN && input.key == ui.KEY_ESCAPE{demo.quit() or >> }
            }
            stats := view.stats()
            if stats.recorded_boundaries > 0 || stats.reused_boundaries > 0 {
                println("View: " + str(stats.recorded_boundaries) + " recorded / " + str(stats.reused_boundaries) + " reused boundaries")
            }
        }
        if model.pending.id > 0 {_ := model.pending.cancel()}
        view.dispose()
        // Native close has already revoked this canvas's images and text layouts.
        if demo.alive(&identity) {
            for i in 0:model.images.len{model.retire_image(i) or >> }
            label := $&model.button_label
            label.dispose() or >>
            check_label := $&model.checkbox_label
            check_label.dispose() or >>
        }
        << 0
    }
    fn worker(ech chan ui.Event) {scene(ech) or(err) {demo.fail(err.msg())
            << }}
    fn launch() int {
        $app := demo.app("Xu UI / Retained Image Workbench", 900, 700) or >>
        xu worker(app.event_ch)
        << app.run() or >>
    }
    fn main() int { << launch() or(err) {eprintln(err.msg())
            << 1}}
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    
    fn open_image(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        if m.pending.id != 0 { << ""}
        $options := ui.file_dialog_options()
        options.title = "Open an image"
        options.filters =[ui.FileFilter{label: "Images", extensions:["png", "jpg", "jpeg"]}]
        m.pending = ui.open_files_async(&m.identity, &options) or(err) { << err.msg()}
        m.message = "Choose a PNG or JPEG in the native dialog."
        m.progress_value(0.2) or(err) { << err.msg()}
        screen.mark_paint(m.header_id) or(err) { << err.msg()}
        screen.mark_paint(m.progress_id) or(err) { << err.msg()}
        << ""
    }
    fn scroll(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        screen.set_scroll(m.scroll_id, 0.0, action.value) or(err) { << err.msg()}
        << ""
    }
    fn register_actions(m &Model, screen &widgets.View) widgets.ActionDispatcher#Model, widgets.View, widgets.Action{
        $d := widgets.action_dispatcher(m, screen)
        d.on(m.button_id, widgets.ACTION_ACTIVATE, open_image) or >>
        d.on(m.scroll_id, widgets.ACTION_SCROLL, scroll) or >>
        << d
    }
  • 16_ui_webview/style_gallery/main.xu

    Required SDK: Xu 0.10.13-dev.1 · Complete project · Download source · events.xu · style.xu

    Xumain.xu
    @main
    #ui
    #ui/draw
    #ui/widgets
    #ui/layout
    #time
    demo #"github.com/xulang-org/examples/ui_demo"
    
    // IDs follow the stable topology created below. All control bounds are local;
    // Editor.place receives the separate canvas rectangle for native IME geometry.
    struct Model{
        theme widgets.Button
        scale widgets.Button
        density widgets.Button
        brand widgets.Button
        disabled widgets.Button
        check widgets.Checkbox
        toggle widgets.Switch
        radio_a widgets.Radio
        radio_b widgets.Radio
        slider widgets.Slider
        stepper widgets.Stepper
        tabs widgets.Tabs
        select_ctrl widgets.Select
        select_origin layout.Rect
        select_popup_armed bool
        transitions []widgets.PaintTransition
        switch_motion widgets.Tween
        popup_motion widgets.Tween
        clock time.Instant
        reduced_motion bool
        theme_index int
        text_scale f64
        density_scale f64
        appearance_dirty bool
        badge widgets.Badge
        divider widgets.Divider
        card widgets.Card
        list widgets.ListBox
        input widgets.Editor
        invalid widgets.Editor
        read_only widgets.Editor
        area widgets.Editor
        progress widgets.Progress
        scroll widgets.Scroll
        context draw.Context
        icon draw.Image
        switcher widgets.StyleSwitcher
        theme_label widgets.StyledLabel
        scale_label widgets.StyledLabel
        density_label widgets.StyledLabel
        brand_label widgets.StyledLabel
        disabled_label widgets.StyledLabel
        check_label widgets.StyledLabel
        toggle_label widgets.StyledLabel
        radio_a_label widgets.StyledLabel
        radio_b_label widgets.StyledLabel
        stepper_label widgets.StyledLabel
        badge_label widgets.StyledLabel
        divider_label widgets.StyledLabel
        card_label widgets.StyledLabel
        tab_label widgets.StyledLabel
        tab_2_label widgets.StyledLabel
        tab_3_label widgets.StyledLabel
        select_label widgets.StyledLabel
        option_auto widgets.StyledLabel
        option_manual widgets.StyledLabel
        option_locked widgets.StyledLabel
        list_label widgets.StyledLabel
        list_2_label widgets.StyledLabel
        list_3_label widgets.StyledLabel
        list_4_label widgets.StyledLabel
    }
    fn (m $&Model) motion_style(id int, base &widgets.ControlStyle, state int) widgets.ControlStyle{
        now := m.clock
        reduced := m.reduced_motion
        motion := $&m.transitions[id]
        << motion.style(base, state, now, reduced) or >>
    }
    fn (m $&Model) tick(view $&widgets.View, now time.Instant) int {
        m.clock = now
        reduced := m.reduced_motion
        for id in 1:m.transitions.len{
            motion := $&m.transitions[id]
            if reduced && motion.is_animating() {motion.finish()
                view.mark_paint(id) or >> }
            else if motion.advance(now) or >> {view.mark_paint(id) or >> }
        }
        $selected := 0.0
        if m.toggle.value() {selected = 1.0}
        switch_motion := $&m.switch_motion
        before_switch := switch_motion.value()
        switch_motion.retarget(selected, now, time.milliseconds(180) or >>, reduced) or >>
        if before_switch != switch_motion.value() {view.mark_paint(32) or >> }
        $opened := 0.0
        if m.select_ctrl.is_open() {opened = 1.0}
        popup_motion := $&m.popup_motion
        before_popup := popup_motion.value()
        $popup_duration := time.milliseconds(130) or >>
        if opened == 0.0 {popup_duration = time.milliseconds(95) or >> }
        popup_motion.retarget(opened, now, popup_duration, reduced) or >>
        if before_popup != popup_motion.value() {view.mark_paint(1) or >> }
        input := $&m.input
        if input.tick(now, reduced) or >> {view.mark_paint(12) or >> }
        invalid := $&m.invalid
        if invalid.tick(now, reduced) or >> {view.mark_paint(13) or >> }
        read_only := $&m.read_only
        if read_only.tick(now, reduced) or >> {view.mark_paint(14) or >> }
        area := $&m.area
        if area.tick(now, reduced) or >> {view.mark_paint(15) or >> }
        << 0
    }
    fn (m &Model) next_frame(now time.Instant) time.Instant{
        if m.switch_motion.is_animating() || m.popup_motion.is_animating() { << now.add(time.milliseconds(16) or >>) or >> }
        for motion in m.transitions{if motion.is_animating() { << now.add(time.milliseconds(16) or >>) or >> }}
        $deadline := time.zero_instant()
        for next in[m.input.next_caret_tick(now, m.reduced_motion) or >>, m.invalid.next_caret_tick(now, m.reduced_motion) or >>,
        m.read_only.next_caret_tick(now, m.reduced_motion) or >>, m.area.next_caret_tick(now, m.reduced_motion) or >>] {
            if !next.is_zero() &&(deadline.is_zero() || next.before(deadline)) {deadline = next}
        }
        << deadline
    }
    fn (m &Model) next_event(ech chan ui.Event) ui.Event{
        deadline := m.next_frame(time.instant()) or >>
        while true {
            event := ui.poll_chan(ech)
            if event.kind != ui.EV_NONE{ << event}
            if !deadline.is_zero() && !time.instant().before(deadline) { << event}
            pause := time.milliseconds(8) or >>
            pause.sleep()
        }
        << ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}
    }
    fn (m $&Model) measure_node(id int, s &widgets.Styles) layout.Size{
        if id == 4 {control := m.theme.clone()
            label := $&m.theme_label
            << control.measure_styled(label, s) or >> }
        if id == 5 {control := m.scale.clone()
            label := $&m.scale_label
            << control.measure_styled(label, s) or >> }
        if id == 6 {control := m.density.clone()
            label := $&m.density_label
            << control.measure_styled(label, s) or >> }
        if id == 8 {control := m.brand.clone()
            label := $&m.brand_label
            << control.measure_icon_styled(label, s) or >> }
        if id == 9 {control := m.disabled.clone()
            label := $&m.disabled_label
            << control.measure_styled(label, s) or >> }
        if id == 10 {control := m.check.clone()
            label := $&m.check_label
            << control.measure_styled(label, s) or >> }
        if id == 11 {control := m.progress.clone()
            << control.measure_styled(s) or >> }
        if id == 12 {control := $&m.input
            << control.measure_styled(s) or >> }
        if id == 13 {control := $&m.invalid
            << control.measure_styled(s) or >> }
        if id == 14 {control := $&m.read_only
            << control.measure_styled(s) or >> }
        if id == 15 {control := $&m.area
            << control.measure_styled(s) or >> }
        if id == 32 {control := m.toggle.clone()
            label := $&m.toggle_label
            << control.measure_styled(label, s) or >> }
        if id == 33 {control := m.radio_a.clone()
            label := $&m.radio_a_label
            << control.measure_styled(label, s) or >> }
        if id == 34 {control := m.radio_b.clone()
            label := $&m.radio_b_label
            << control.measure_styled(label, s) or >> }
        if id == 35 {control := m.slider.clone()
            << control.measure_styled(s) or >> }
        if id == 36 {control := m.stepper.clone()
            label := $&m.stepper_label
            << control.measure_styled(label, s) or >> }
        if id == 37 {control := m.badge.clone()
            label := $&m.badge_label
            << control.measure_styled(label, s) or >> }
        if id == 38 {control := m.divider.clone()
            label := $&m.divider_label
            << control.measure_labeled_styled(label, s) or >> }
        if id == 40 {control := m.tabs.clone()
            label := $&m.tab_label
            << control.measure_styled(label, s) or >> }
        if id == 41 {control := m.select_ctrl.clone()
            label := $&m.select_label
            << control.measure_styled(label, s) or >> }
        if id == 42 {control := m.card.clone()
            label := $&m.card_label
            << control.measure_header_styled(label, s) or >> }
        if id == 43 {control := m.list.clone()
            label := $&m.list_label
            << control.measure_styled(label, s) or >> }
        << layout.Size{width: 0.0, height: 0.0}
    }
    fn (m $&Model) measure_styled(id int, s &widgets.Styles) layout.Size{
        << m.measure_node(id, s) or(err) {eprintln(err.msg())
            << layout.Size{width: - 1.0, height: - 1.0}}
    }
    fn (m $&Model) draw_node(id int, b &layout.Rect, s &widgets.Styles, f $&draw.Frame) int {
        if id == 4 {target := $&m.theme
            target.set_bounds(b) or >>
            $control := m.theme.clone()
            base := control.style_or(s)
            appearance := m.motion_style(4, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.theme_label
            control.paint_styled(f, label, s) or >> }
        if id == 5 {target := $&m.scale
            target.set_bounds(b) or >>
            $control := m.scale.clone()
            base := control.style_or(s)
            appearance := m.motion_style(5, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.scale_label
            control.paint_styled(f, label, s) or >> }
        if id == 6 {target := $&m.density
            target.set_bounds(b) or >>
            $control := m.density.clone()
            base := control.style_or(s)
            appearance := m.motion_style(6, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.density_label
            control.paint_styled(f, label, s) or >> }
        if id == 8 {target := $&m.brand
            target.set_bounds(b) or >>
            $control := m.brand.clone()
            base := control.style_or(s)
            appearance := m.motion_style(8, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            icon := m.icon
            label := $&m.brand_label
            control.paint_icon_styled(f, label, &icon, s) or >> }
        if id == 9 {target := $&m.disabled
            target.set_bounds(b) or >>
            $control := m.disabled.clone()
            base := control.style_or(s)
            appearance := m.motion_style(9, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.disabled_label
            control.paint_styled(f, label, s) or >> }
        if id == 10 {target := $&m.check
            target.set_bounds(b) or >>
            $control := m.check.clone()
            base := control.style_or(s)
            appearance := m.motion_style(10, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.check_label
            control.paint_styled(f, label, s) or >> }
        if id == 12 {
            now := m.clock
            reduced := m.reduced_motion
            $motion := m.transitions[12]
            control := $&m.input
            control.paint_motion_styled(f, s, $&motion, now, reduced) or >>
            m.transitions[12] = motion}
        if id == 13 {
            now := m.clock
            reduced := m.reduced_motion
            $motion := m.transitions[13]
            control := $&m.invalid
            control.paint_motion_styled(f, s, $&motion, now, reduced) or >>
            m.transitions[13] = motion}
        if id == 14 {
            now := m.clock
            reduced := m.reduced_motion
            $motion := m.transitions[14]
            control := $&m.read_only
            control.paint_motion_styled(f, s, $&motion, now, reduced) or >>
            m.transitions[14] = motion}
        if id == 15 {
            now := m.clock
            reduced := m.reduced_motion
            $motion := m.transitions[15]
            control := $&m.area
            control.paint_motion_styled(f, s, $&motion, now, reduced) or >>
            m.transitions[15] = motion}
        if id == 11 {control := $&m.progress
            control.set_bounds(b) or >>
            control.paint_styled(f, s) or >> }
        if id == 32 {target := $&m.toggle
            target.set_bounds(b) or >>
            $control := m.toggle.clone()
            base := control.style_or(s)
            appearance := m.motion_style(32, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            position := m.switch_motion.value()
            label := $&m.toggle_label
            control.paint_position_styled(f, label, s, position) or >> }
        if id == 33 {target := $&m.radio_a
            target.set_bounds(b) or >>
            $control := m.radio_a.clone()
            base := control.style_or(s)
            appearance := m.motion_style(33, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.radio_a_label
            control.paint_styled(f, label, s) or >> }
        if id == 34 {target := $&m.radio_b
            target.set_bounds(b) or >>
            $control := m.radio_b.clone()
            base := control.style_or(s)
            appearance := m.motion_style(34, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.radio_b_label
            control.paint_styled(f, label, s) or >> }
        if id == 35 {target := $&m.slider
            target.set_bounds(b) or >>
            $control := m.slider.clone()
            base := control.style_or(s)
            appearance := m.motion_style(35, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            control.paint_styled(f, s) or >> }
        if id == 36 {target := $&m.stepper
            target.set_bounds(b) or >>
            $control := m.stepper.clone()
            base := control.style_or(s)
            appearance := m.motion_style(36, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.stepper_label
            control.paint_styled(f, label, s) or >> }
        if id == 37 {target := $&m.badge
            target.set_bounds(b) or >>
            control := m.badge.clone()
            label := $&m.badge_label
            control.paint_styled(f, label, s) or >> }
        if id == 38 {target := $&m.divider
            target.set_bounds(b) or >>
            control := m.divider.clone()
            label := $&m.divider_label
            control.paint_labeled_styled(f, label, s) or >> }
        if id == 40 {target := $&m.tabs
            target.set_bounds(b) or >>
            control := m.tabs.clone()
            control.paint_box_styled(f, s) or >>
            l0 := $&m.tab_label
            control.paint_tab_styled(f, 0, l0, s) or >>
            l1 := $&m.tab_2_label
            control.paint_tab_styled(f, 1, l1, s) or >>
            l2 := $&m.tab_3_label
            control.paint_tab_styled(f, 2, l2, s) or >> }
        if id == 41 {target := $&m.select_ctrl
            target.set_bounds(b) or >>
            $control := m.select_ctrl.clone()
            base := control.style_or(s)
            appearance := m.motion_style(41, &base, control.visual_state()) or >>
            control.set_style(&appearance) or >>
            label := $&m.select_label
            control.paint_styled(f, label, s) or >> }
        if id == 42 {target := $&m.card
            target.set_bounds(b) or >>
            control := m.card.clone()
            label := $&m.card_label
            control.paint_header_styled(f, label, s) or >>
            demo.text(&m.context, f, 14.0 * s.density, 42.0 * s.density, 11.0 * s.text_scale, s.button.palette.muted, "Card body") or >> }
        if id == 43 {target := $&m.list
            target.set_bounds(b) or >>
            control := m.list.clone()
            control.paint_box_styled(f, s) or >>
            r0 := $&m.list_label
            control.paint_item_styled(f, 0, r0, s) or >>
            r1 := $&m.list_2_label
            control.paint_item_styled(f, 1, r1, s) or >>
            r2 := $&m.list_3_label
            control.paint_item_styled(f, 2, r2, s) or >>
            r3 := $&m.list_4_label
            control.paint_item_styled(f, 3, r3, s) or >> }
        if id == 2 {
            demo.text(&m.context, f, 0.0, 0.0, 24.0, s.button.palette.foreground, "A theme that reaches every control") or >>
            demo.text(&m.context, f, 0.0, 33.0, 13.0, s.button.palette.muted, "Light / dark / contrast · typography · density · local overrides · no idle redraw") or >>
        }
        if id >= 18 && id <= 29 {
            f.fill_rect(0.0, 0.0, b.width, b.height, s.input.palette.normal) or >>
            demo.text(&m.context, f, 12.0, 5.0, 14.0, s.input.palette.foreground, "Scrollable item " + str(id - 17) + "   —   wheel, drag the thumb, or Page Down") or >>
        }
        if id == 30 {
            demo.text(&m.context, f, 0.0, 0.0, 12.0, s.button.palette.muted, "The green button keeps its own font and palette. Error and read-only fields are distinct states.") or >>
            demo.text(&m.context, f, 0.0, 21.0, 12.0, s.button.palette.muted, "Tab / Shift+Tab to move focus · copy from read-only text · Escape to quit") or >>
        }
        << 0
    }
    fn (m $&Model) paint_styled(id int, b &layout.Rect, s &widgets.Styles, f $&draw.Frame) bool {
        m.draw_node(id, b, s, f) or(err) {eprintln(err.msg())
            << false}
        << true
    }
    fn (m $&Model) overlay_styled(id int, b &layout.Rect, s &widgets.Styles, f $&draw.Frame) bool {
        if id == 16 {control := $&m.scroll
            control.paint_scrollbar(f, s) or(err) {eprintln(err.msg())
                << false}}
        if id == 1 &&(m.select_ctrl.is_open() || m.popup_motion.value() > 0.0) {
            m.paint_select_popup(s, f) or(err) {eprintln(err.msg())
                << false}
        }
        << true
    }
    // Root overlay keeps the popup above every sibling and outside the button's box.
    fn (m $&Model) paint_select_popup(s &widgets.Styles, f $&draw.Frame) int {
        $control := m.select_ctrl.clone()
        control.set_open(true)
        opacity := m.popup_motion.value()
        if opacity <= 0.0 { << 0}
        base := control.style_or(s)
        appearance := base.with_opacity(opacity) or >>
        control.set_style(&appearance) or >>
        popup := control.popup_bounds(s)
        $offset := - 4.0 *(1.0 - opacity)
        if popup.y < 0.0 {offset = 4.0 *(1.0 - opacity)}
        f.push() or >>
        f.translate(m.select_origin.x, m.select_origin.y + offset) or >>
        control.paint_popup_box_styled(f, s) or >>
        auto_label := $&m.option_auto
        control.paint_option_styled(f, 0, auto_label, s) or >>
        manual_label := $&m.option_manual
        control.paint_option_styled(f, 1, manual_label, s) or >>
        locked_label := $&m.option_locked
        control.paint_option_styled(f, 2, locked_label, s) or >>
        f.pop() or >>
        << 0
    }
    // The popup is an overlay, so route its pointer sequence before normal tree hits.
    fn (m $&Model) dispatch_input(view $&widgets.View, event &ui.InputEvent)[]widgets.Action{
        was_open := m.select_ctrl.is_open()
        pointer := event.kind == ui.EV_POINTER_DOWN || event.kind == ui.EV_POINTER_UP ||
        event.kind == ui.EV_POINTER_MOVE || event.kind == ui.EV_POINTER_SCROLL
        if pointer &&(was_open || m.select_popup_armed) {
            local := view.local_input(41, event) or >>
            styles := view.styles_for(41) or >>
            pop := m.select_ctrl.popup_bounds(&styles)
            if pop.contains(local.x, local.y) || m.select_popup_armed{
                if event.kind == ui.EV_POINTER_DOWN && event.button == ui.BUTTON_LEFT{m.select_popup_armed = true}
                control := $&m.select_ctrl
                action := control.input(&local) or >>
                view.set_pointer_cursor(ui.CURSOR_HAND) or >>
                if event.kind == ui.EV_POINTER_UP{m.select_popup_armed = false}
                view.mark_paint(41) or >>
                view.mark_paint(1) or >>
                <<[action]
            }
        }
        if event.kind == ui.EV_POINTER_CANCEL{m.select_popup_armed = false}
        actions := widgets.dispatch(view, event, m) or >>
        if was_open || m.select_ctrl.is_open() {view.mark_paint(1) or >> }
        << actions
    }
    fn (m $&Model) dispatch_event(view $&widgets.View, event &ui.Event)[]widgets.Action{
        if ui.is_input_event(event.kind) {
            input := ui.input_of(event) or >>
            << m.dispatch_input(view, &input) or >>
        }
        was_open := m.select_ctrl.is_open()
        actions := widgets.dispatch_event(view, event, m) or >>
        m.select_popup_armed = false
        if was_open && !m.select_ctrl.is_open() {view.mark_paint(1) or >> }
        << actions
    }
    fn (m $&Model) input(id int, kind int, event &ui.InputEvent) widgets.Action{
        if id == 4 {control := $&m.theme
            << control.route(kind, event) or >> }
        if id == 5 {control := $&m.scale
            << control.route(kind, event) or >> }
        if id == 6 {control := $&m.density
            << control.route(kind, event) or >> }
        if id == 8 {control := $&m.brand
            << control.route(kind, event) or >> }
        if id == 9 {control := $&m.disabled
            << control.route(kind, event) or >> }
        if id == 10 {control := $&m.check
            << control.route(kind, event) or >> }
        if id == 12 {control := $&m.input
            << control.route(kind, event) or >> }
        if id == 13 {control := $&m.invalid
            << control.route(kind, event) or >> }
        if id == 14 {control := $&m.read_only
            << control.route(kind, event) or >> }
        if id == 15 {control := $&m.area
            << control.route(kind, event) or >> }
        if id == 16 {control := $&m.scroll
            << control.route(kind, event) or >> }
        if id == 32 {control := $&m.toggle
            << control.route(kind, event) or >> }
        if id == 33 {control := $&m.radio_a
            << control.route(kind, event) or >> }
        if id == 34 {control := $&m.radio_b
            << control.route(kind, event) or >> }
        if id == 35 {control := $&m.slider
            << control.route(kind, event) or >> }
        if id == 36 {control := $&m.stepper
            << control.route(kind, event) or >> }
        if id == 40 {control := $&m.tabs
            << control.route(kind, event) or >> }
        if id == 41 {control := $&m.select_ctrl
            << control.route(kind, event) or >> }
        if id == 43 {control := $&m.list
            << control.route(kind, event) or >> }
        << widgets.Action{kind: 0, id: id, needs_paint: false, request_focus: false, consumed: false, value: 0.0}
    }
    fn (m $&Model) place(view $&widgets.View) int {
        select_bounds := view.node_bounds(41) or >>
        m.select_origin = select_bounds
        select_styles := view.styles_for(41) or >>
        select_control := $&m.select_ctrl
        select_control.set_bounds(&layout.Rect{x: 0.0, y: 0.0, width: select_bounds.width, height: select_bounds.height}) or >>
        select_control.apply_styles(&select_styles) or >>
        popup := select_control.popup_bounds(&select_styles)
        window_bounds := view.node_bounds(1) or >>
        below := window_bounds.y + window_bounds.height - select_bounds.y - select_bounds.height
        above := select_bounds.y - window_bounds.y
        select_control.set_popup_above(below < popup.height + 2.0 * select_styles.density && above > below)
        list_bounds := view.node_bounds(43) or >>
        list_styles := view.styles_for(43) or >>
        list_control := $&m.list
        list_control.set_bounds(&layout.Rect{x: 0.0, y: 0.0, width: list_bounds.width, height: list_bounds.height}) or >>
        list_control.apply_styles(&list_styles) or >>
        input := $&m.input
        widgets.place_editor(view, input) or >>
        invalid := $&m.invalid
        widgets.place_editor(view, invalid) or >>
        read_only := $&m.read_only
        widgets.place_editor(view, read_only) or >>
        area := $&m.area
        widgets.place_editor(view, area) or >>
        bounds := view.node_bounds(16) or >>
        styles := view.styles_for(16) or >>
        control := $&m.scroll
        control.set_bounds(&layout.Rect{x: 0.0, y: 0.0, width: bounds.width, height: bounds.height}) or >>
        control.apply_styles(&styles) or >>
        view.set_scroll(16, 0.0, control.offset()) or >>
        << 0
    }
    fn (m $&Model) native_event(view $&widgets.View, event &ui.Event) int {
        input := $&m.input
        action_12 := input.event(event) or >>
        if action_12.needs_paint{view.mark_paint(12) or >> }
        invalid := $&m.invalid
        action_13 := invalid.event(event) or >>
        if action_13.needs_paint{view.mark_paint(13) or >> }
        read_only := $&m.read_only
        action_14 := read_only.event(event) or >>
        if action_14.needs_paint{view.mark_paint(14) or >> }
        area := $&m.area
        action_15 := area.event(event) or >>
        if action_15.needs_paint{view.mark_paint(15) or >> }
        << 0
    }
    fn (m $&Model) acknowledge() {
        theme := $&m.theme
        theme.painted()
        scale := $&m.scale
        scale.painted()
        density := $&m.density
        density.painted()
        brand := $&m.brand
        brand.painted()
        disabled := $&m.disabled
        disabled.painted()
        check := $&m.check
        check.painted()
        input := $&m.input
        input.painted()
        invalid := $&m.invalid
        invalid.painted()
        read_only := $&m.read_only
        read_only.painted()
        area := $&m.area
        area.painted()
        progress := $&m.progress
        progress.painted()
        scroll := $&m.scroll
        scroll.painted()
        toggle := $&m.toggle
        toggle.painted()
        radio_a := $&m.radio_a
        radio_a.painted()
        radio_b := $&m.radio_b
        radio_b.painted()
        slider := $&m.slider
        slider.painted()
        stepper := $&m.stepper
        stepper.painted()
        tabs := $&m.tabs
        tabs.painted()
        select_ctrl := $&m.select_ctrl
        select_ctrl.painted()
        badge := $&m.badge
        badge.painted()
        divider := $&m.divider
        divider.painted()
        card := $&m.card
        card.painted()
        list := $&m.list
        list.painted()
    }
    fn (m $&Model) cleanup() {
        icon := $&m.icon
        icon.dispose() or(err) {eprintln(err.msg())
            << }
        theme_label := $&m.theme_label
        theme_label.dispose()
        scale_label := $&m.scale_label
        scale_label.dispose()
        density_label := $&m.density_label
        density_label.dispose()
        brand_label := $&m.brand_label
        brand_label.dispose()
        disabled_label := $&m.disabled_label
        disabled_label.dispose()
        check_label := $&m.check_label
        check_label.dispose()
        toggle_label := $&m.toggle_label
        toggle_label.dispose()
        radio_a_label := $&m.radio_a_label
        radio_a_label.dispose()
        radio_b_label := $&m.radio_b_label
        radio_b_label.dispose()
        stepper_label := $&m.stepper_label
        stepper_label.dispose()
        badge_label := $&m.badge_label
        badge_label.dispose()
        divider_label := $&m.divider_label
        divider_label.dispose()
        card_label := $&m.card_label
        card_label.dispose()
        tab_label := $&m.tab_label
        tab_label.dispose()
        tab_2_label := $&m.tab_2_label
        tab_2_label.dispose()
        tab_3_label := $&m.tab_3_label
        tab_3_label.dispose()
        select_label := $&m.select_label
        select_label.dispose()
        option_auto := $&m.option_auto
        option_auto.dispose()
        option_manual := $&m.option_manual
        option_manual.dispose()
        option_locked := $&m.option_locked
        option_locked.dispose()
        list_label := $&m.list_label
        list_label.dispose()
        list_2_label := $&m.list_2_label
        list_2_label.dispose()
        list_3_label := $&m.list_3_label
        list_3_label.dispose()
        list_4_label := $&m.list_4_label
        list_4_label.dispose()
        input := $&m.input
        input.dispose()
        invalid := $&m.invalid
        invalid.dispose()
        read_only := $&m.read_only
        read_only.dispose()
        area := $&m.area
        area.dispose()
    }
    fn leaf(view $&widgets.View, parent int, width f64, height f64) int {
        style := layout.box_style(layout.BOX_LEAF)
        << view.add(parent, &style, &layout.Size{width: width, height: height}) or >>
    }
    fn brand_scope(view $&widgets.View) int {
        $brand := widgets.light_styles()
        brand.button.palette.normal = draw.rgb(10, 91, 69)
        brand.button.palette.hovered = draw.rgb(17, 120, 90)
        brand.button.palette.pressed = draw.rgb(7, 65, 49)
        brand.button.palette.foreground = draw.rgb(255, 255, 255)
        brand.button.font.size = 17.0
        brand.button.font.weight = 600
        brand.button.inherit_font = false
        brand.button.radius = 18.0
        brand.button.icon_size = 22.0
        brand.button.icon_placement = widgets.ICON_TRAILING
        $hover := widgets.state_paint(widgets.STATE_HOVERED)
        hover.unless = widgets.STATE_DISABLED
        hover.fields = widgets.PAINT_FOREGROUND | widgets.PAINT_BORDER
        hover.foreground = draw.rgb(209, 250, 229)
        hover.border = draw.rgb(110, 231, 183)
        brand.button.states =[hover]
        brand.button.shadow = draw.rgba(0, 0, 0, 28)
        brand.button.shadow_y = 2.0
        brand.button.shadow_blur = 6.0
        view.set_style_scope(8, &brand) or >>
        << 0
    }
    fn scene(ech chan ui.Event) int {
        ready := demo.ready(ech) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        identity := ui.canvas_of(&ready) or >>
        context := draw.context_of(&ready) or >>
        host := widgets.Host{context: context, identity: identity}
        $column := layout.box_style(layout.BOX_COLUMN)
        column.padding = layout.insets(22.0) or >>
        column.gap = 10.0
        column.cross_alignment = layout.CROSS_STRETCH
        $view := host.view(&column, draw.rgb(20, 25, 34)) or >>
        _ := leaf($&view, 1, 400.0, 56.0) or >>  // 2 header
        $row := layout.box_style(layout.BOX_ROW)
        row.gap = 12.0
        row.cross_alignment = layout.CROSS_CENTER
        _ := view.add(1, &row, &layout.Size{width: 0.0, height: 0.0}) or >>  // 3 toolbar
        for i in 0:3 {_ := leaf($&view, 3, 0.0, 0.0) or >> }  // 4..6
        _ := view.add(1, &row, &layout.Size{width: 0.0, height: 0.0}) or >>  // 7 controls
        for i in 0:3 {_ := leaf($&view, 7, 0.0, 0.0) or >> }  // 8..10
        _ := leaf($&view, 1, 300.0, 12.0) or >>  // 11 progress
        for i in 0:4 {_ := leaf($&view, 1, 300.0, 0.0) or >> }  // 12..15 editors
        $viewport := layout.box_style(layout.BOX_COLUMN)
        viewport.height = 84.0
        viewport.clip = true
        viewport.cross_alignment = layout.CROSS_STRETCH
        _ := view.add(1, &viewport, &layout.Size{width: 0.0, height: 0.0}) or >>  // 16 scroll
        $items := layout.box_style(layout.BOX_COLUMN)
        items.gap = 6.0
        items.cross_alignment = layout.CROSS_STRETCH
        _ := view.add(16, &items, &layout.Size{width: 0.0, height: 0.0}) or >>  // 17 items
        for i in 0:12 {_ := leaf($&view, 17, 300.0, 28.0) or >> }  // 18..29
        _ := leaf($&view, 1, 400.0, 42.0) or >>  // 30 footer
        _ := view.add(1, &row, &layout.Size{width: 0.0, height: 0.0}) or >>  // 31 extended controls row 1
        for i in 0:6 {_ := leaf($&view, 31, 0.0, 0.0) or >> }  // 32..37: switch, radio_a, radio_b, slider, stepper, badge
        _ := leaf($&view, 1, 300.0, 0.0) or >>  // 38 labeled divider
        _ := view.add(1, &row, &layout.Size{width: 0.0, height: 0.0}) or >>  // 39 extended controls row 2
        for i in 0:4 {_ := leaf($&view, 39, 0.0, 0.0) or >> }  // 40..43: tabs, select, card, list_box
        for id in[2, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43] {view.set_boundary(id, true) or >> }
        for id in[4, 5, 6, 8, 10, 12, 13, 14, 15, 16, 32, 33, 34, 35, 36, 40, 41, 43] {view.set_input(id, true, true) or >> }
        view.set_capture_outside(16, true) or >>
        view.set_capture_outside(35, true) or >>
        for id in[4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43] {view.set_style_measure(id, true) or >> }
        empty := layout.Rect{x: 0.0, y: 0.0, width: 0.0, height: 0.0}
        $m := Model{theme: widgets.button(&identity, 4, &empty) or >>, scale: widgets.button(&identity, 5, &empty) or >>,
            density: widgets.button(&identity, 6, &empty) or >>, brand: widgets.button(&identity, 8, &empty) or >>,
            disabled: widgets.button(&identity, 9, &empty) or >>, check: widgets.checkbox(&identity, 10, &empty, true) or >>,
            toggle: widgets.switch_control(&identity, 32, &empty, true) or >>,
            radio_a: widgets.radio(&identity, 33, &empty, 0, true) or >>,
            radio_b: widgets.radio(&identity, 34, &empty, 1, false) or >>,
            slider: widgets.slider(&identity, 35, &empty, 0.0, 100.0, 64.0) or >>,
            stepper: widgets.stepper(&identity, 36, &empty, 0.0, 100.0, 5.0, 65.0) or >>,
            tabs: widgets.tabs(&identity, 40, &empty, 3, 0) or >>,
            select_ctrl: widgets.select_box(&identity, 41, &empty, 3, 0) or >>,
            select_origin: empty, select_popup_armed: false,
            transitions:[]widgets.PaintTransition{}, switch_motion: widgets.tween(1.0) or >>, popup_motion: widgets.tween(0.0) or >>,
            clock: time.zero_instant(), reduced_motion: false, theme_index: 0, text_scale: 1.0, density_scale: 1.0, appearance_dirty: true,
            badge: widgets.badge(&empty) or >>,
            divider: widgets.divider(&empty, widgets.AXIS_HORIZONTAL) or >>,
            card: widgets.card(&empty) or >>,
            list: widgets.list_box(&identity, 43, &empty, 4, 0) or >>,
            input: widgets.input(&context, &identity, 12, &empty, &"Editable input · 你好 Xu") or >>,
            invalid: widgets.input(&context, &identity, 13, &empty, &"Invalid value — custom error colors") or >>,
            read_only: widgets.input(&context, &identity, 14, &empty, &"Read-only · select and copy, edits are ignored") or >>,
            area: widgets.text_area(&context, &identity, 15, &empty, &"TextArea uses the same font, padding and selection theme.\nIME, preedit and caret geometry follow typography changes.") or >>,
            progress: widgets.progress(&empty, 0.64) or >>, scroll: widgets.scroll(&identity, 16, &empty, widgets.AXIS_VERTICAL, 402.0) or >>,
            context: context, icon: context.load_embedded_image(&"logo.png") or >>, switcher: widgets.style_switcher(),
            theme_label: widgets.styled_label(&context, &"Theme: dark / light / contrast"),
            scale_label: widgets.styled_label(&context, &"Text: 100% / 140%"),
            density_label: widgets.styled_label(&context, &"Density: normal / compact"),
            brand_label: widgets.styled_label(&context, &"Local green"),
            disabled_label: widgets.styled_label(&context, &"Disabled"),
            check_label: widgets.styled_label(&context, &"Checkbox"),
            toggle_label: widgets.styled_label(&context, &"Switch"),
            radio_a_label: widgets.styled_label(&context, &"Radio A"),
            radio_b_label: widgets.styled_label(&context, &"Radio B"),
            stepper_label: widgets.styled_label(&context, &"65"),
            badge_label: widgets.styled_label(&context, &"Active"),
            divider_label: widgets.styled_label(&context, &"Navigation & Data Components"),
            card_label: widgets.styled_label(&context, &"Card Panel"),
            tab_label: widgets.styled_label(&context, &"Overview"),
            tab_2_label: widgets.styled_label(&context, &"Tokens"),
            tab_3_label: widgets.styled_label(&context, &"Themes"),
            select_label: widgets.styled_label(&context, &"Option: Auto"),
            option_auto: widgets.styled_label(&context, &"Auto"),
            option_manual: widgets.styled_label(&context, &"Manual"),
            option_locked: widgets.styled_label(&context, &"Locked"),
            list_label: widgets.styled_label(&context, &"1 · Buttons"),
            list_2_label: widgets.styled_label(&context, &"2 · Editors"),
            list_3_label: widgets.styled_label(&context, &"3 · Surfaces"),
            list_4_label: widgets.styled_label(&context, &"4 · Controls")}
        for i in 0:44 {m.transitions.push(widgets.paint_transition() or >>)}
        for id in[4, 5, 6, 8, 10, 32, 33, 34, 36, 40, 41, 43] {view.set_cursor(id, ui.CURSOR_HAND) or >> }
        for id in[12, 13, 14, 15] {view.set_cursor(id, ui.CURSOR_TEXT) or >> }
        view.set_cursor(35, ui.CURSOR_RESIZE_HORIZONTAL) or >>
        badge_ref := $&m.badge
        badge_ref.set_selected(true)
        disabled := $&m.disabled
        disabled.set_enabled(false)
        invalid := $&m.invalid
        invalid.set_invalid(true)
        read_only := $&m.read_only
        read_only.set_read_only(true) or >>
        apply_appearance($&m, $&view) or >>
        brand_scope($&view) or >>
        dispatcher := register_actions(&m, &view) or >>
        $width := 960.0
        $height := 820.0
        $event := ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}
        // Drain input bursts before painting. Native text snapshots already hold
        // the latest revision; rendering each queued key would fill the frame queue.
        ui.request_canvas_preferences(&identity) or >>
        while true {
            if event.kind == ui.EV_NONE{
                apply_appearance($&m, $&view) or >>
                m.tick($&view, time.instant()) or >>
                constraints := layout.tight(width, height) or >>
                _ := widgets.layout_styled($&view, &constraints, $&m) or >>
                m.place($&view) or >>
                if widgets.present_styled($&view, &constraints, $&m) or >> {m.acknowledge()}
                event = m.next_event(ech)
            }
            if event.kind == ui.EV_EXIT{ <- }
            if event.window_id == identity.window_id{
                if event.kind == ui.EV_CANVAS_CLOSED || event.kind == ui.EV_CLOSED{ <- }
                if event.kind == ui.EV_CANVAS_METRICS{metrics := ui.metrics_of(&event) or >>
                    width = metrics.width
                    height = metrics.height}
                if event.kind == ui.EV_FOCUSED{ui.request_canvas_preferences(&identity) or >> }
                if event.kind == ui.EV_CANVAS_PREFERENCES{
                    preferences := ui.canvas_preferences_of(&event) or >>
                    if preferences.identity.canvas_id == identity.canvas_id && preferences.identity.generation == identity.generation{
                        m.reduced_motion = preferences.reduced_motion
                        view.mark_paint(1) or >>
                    }
                }
                popup_was_open := m.select_ctrl.is_open()
                actions := m.dispatch_event($&view, &event) or >>
                m.native_event($&view, &event) or >>
                for action in actions{_ := dispatcher.dispatch(&action, $&m, $&view) or >> }
                if ui.is_input_event(event.kind) {input := ui.input_of(&event) or >>
                    if input.kind == ui.EV_KEY_DOWN && input.key == ui.KEY_ESCAPE && !popup_was_open{
                        view.dispose()
                        if demo.alive(&identity) {m.cleanup()}
                        demo.quit() or >>
                        << 0
                    }}
            }
            event = ui.poll_chan(ech)
        }
        view.dispose()
        if demo.alive(&identity) {m.cleanup()}
        << 0
    }
    fn worker(ech chan ui.Event) {scene(ech) or(err) {demo.fail(err.msg())
            << }}
    fn main() int {
        $app := demo.app("Xu UI / Style Gallery", 960, 820) or(err) {eprintln(err.msg())
            << 1}
        xu worker(app.event_ch)
        << app.run() or(err) {eprintln(err.msg())
            << 1}
    }
    Xuevents.xu
    @main
    
    #ui
    #ui/widgets
    
    fn choose_theme(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        m.theme_index =(m.theme_index + 1) % 3
        m.appearance_dirty = true
        << ""
    }
    fn choose_scale(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        if m.text_scale == 1.0 {m.text_scale = 1.4} else {m.text_scale = 1.0}
        m.appearance_dirty = true
        << ""
    }
    fn choose_density(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        if m.density_scale == 1.0 {m.density_scale = 0.8} else {m.density_scale = 1.0}
        m.appearance_dirty = true
        << ""
    }
    fn cycle_option(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        sel := $&m.select_ctrl
        next_opt :=(sel.selected() + 1) % 3
        sel.set_selected(next_opt) or(err) { << err.msg()}
        lbl := $&m.select_label
        if next_opt == 0 {lbl.set_text(&"Option: Auto")}
        if next_opt == 1 {lbl.set_text(&"Option: Manual")}
        if next_opt == 2 {lbl.set_text(&"Option: Locked")}
        screen.mark_measure(41) or(err) { << err.msg()}
        screen.mark_paint(41) or(err) { << err.msg()}
        << ""
    }
    fn scroll(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        screen.set_scroll(16, 0.0, action.value) or(err) { << err.msg()}
        << ""
    }
    fn toggle_badge(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        bdg := $&m.badge
        bdg.set_selected(action.value > 0.5)
        blbl := $&m.badge_label
        if action.value > 0.5 {blbl.set_text(&"Active")} else {blbl.set_text(&"Paused")}
        screen.mark_measure(37) or(err) { << err.msg()}
        screen.mark_paint(37) or(err) { << err.msg()}
        << ""
    }
    fn radio_a_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        rb := $&m.radio_b
        rb.set_value(false)
        screen.mark_paint(34) or(err) { << err.msg()}
        << ""
    }
    fn radio_b_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        ra := $&m.radio_a
        ra.set_value(false)
        screen.mark_paint(33) or(err) { << err.msg()}
        << ""
    }
    fn slider_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        prog := $&m.progress
        prog.set_value(action.value / 100.0) or(err) { << err.msg()}
        screen.mark_paint(11) or(err) { << err.msg()}
        << ""
    }
    fn stepper_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        lbl := $&m.stepper_label
        lbl.set_text(&str(int(action.value)))
        screen.mark_measure(36) or(err) { << err.msg()}
        prog := $&m.progress
        prog.set_value(action.value / 100.0) or(err) { << err.msg()}
        screen.mark_paint(11) or(err) { << err.msg()}
        << ""
    }
    fn tabs_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        clbl := $&m.card_label
        if action.value == 0.0 {clbl.set_text(&"Card · Overview")}
        if action.value == 1.0 {clbl.set_text(&"Card · Tokens")}
        if action.value == 2.0 {clbl.set_text(&"Card · Segmented")}
        screen.mark_measure(42) or(err) { << err.msg()}
        screen.mark_paint(42) or(err) { << err.msg()}
        << ""
    }
    fn option_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        lbl := $&m.select_label
        if action.value == 0.0 {lbl.set_text(&"Option: Auto")}
        if action.value == 1.0 {lbl.set_text(&"Option: Manual")}
        if action.value == 2.0 {lbl.set_text(&"Option: Locked")}
        screen.mark_measure(41) or(err) { << err.msg()}
        screen.mark_paint(41) or(err) { << err.msg()}
        << ""
    }
    fn row_changed(m $&Model, screen $&widgets.View, action &widgets.Action) string {
        clbl := $&m.card_label
        clbl.set_text(&("Card · Row " + str(int(action.value) + 1)))
        screen.mark_measure(42) or(err) { << err.msg()}
        screen.mark_paint(42) or(err) { << err.msg()}
        << ""
    }
    fn register_actions(m &Model, screen &widgets.View) widgets.ActionDispatcher#Model, widgets.View, widgets.Action{
        $d := widgets.action_dispatcher(m, screen)
        d.on(4, widgets.ACTION_ACTIVATE, choose_theme) or >>
        d.on(5, widgets.ACTION_ACTIVATE, choose_scale) or >>
        d.on(6, widgets.ACTION_ACTIVATE, choose_density) or >>
        d.on(41, widgets.ACTION_ACTIVATE, cycle_option) or >>
        d.on(16, widgets.ACTION_SCROLL, scroll) or >>
        d.on(32, widgets.ACTION_CHANGE, toggle_badge) or >>
        d.on(33, widgets.ACTION_CHANGE, radio_a_changed) or >>
        d.on(34, widgets.ACTION_CHANGE, radio_b_changed) or >>
        d.on(35, widgets.ACTION_CHANGE, slider_changed) or >>
        d.on(36, widgets.ACTION_CHANGE, stepper_changed) or >>
        d.on(40, widgets.ACTION_CHANGE, tabs_changed) or >>
        d.on(41, widgets.ACTION_CHANGE, option_changed) or >>
        d.on(43, widgets.ACTION_CHANGE, row_changed) or >>
        << d
    }
    Xustyle.xu
    @main
    
    #ui
    #ui/widgets
    
    fn apply_appearance(m $&Model, view $&widgets.View) int {
        if !m.appearance_dirty{ << 0}
        theme := m.theme_index
        scale := m.text_scale
        density := m.density_scale
        switcher := $&m.switcher
        switcher.use_preset(theme) or >>
        switcher.set_text_scale(scale) or >>
        switcher.set_density(density) or >>
        switcher.apply(view) or >>
        m.appearance_dirty = false
        << 0
    }
  • 16_ui_webview/component_workshop/main.xu

    Required SDK: Xu 0.10.13-dev.3 · Complete project · Download source · events.xu · events_tools.xu · layout.xu · model.xu · style.xu · view.xu

    Xumain.xu
    @main
    
    #ui
    #ui/widgets
    #time
    demo #"github.com/xulang-org/examples/ui_demo"
    
    fn scene(events chan ui.Event) int {
        ready := demo.ready(events) or >>
        if ready.kind == ui.EV_EXIT{ << 0}
        $screen := widgets.screen(&ready) or >>
        screen.resize(1180.0, 900.0) or(err) {screen.dispose()
            >> err}
        screen.set_min_size(920, 780) or(err) {screen.dispose()
            >> err}
        $model := create($&screen) or(err) {screen.dispose()
            >> err}
        workshop_loop(events, $&model, $&screen) or(err) {screen.dispose()
            >> err}
        screen.dispose()
        << 0
    }
    
    fn worker(events chan ui.Event) {scene(events) or(err) {demo.fail(err.msg())
            << }}
    
    fn launch() int {
        $app := demo.app("XUUI / Component Workshop", 1180, 900) or >>
        xu worker(app.event_ch)
        << app.run() or >>
    }
    
    fn main() int { << launch() or(err) {eprintln(err.msg())
            << 1}}
    
    fn next_event(events chan ui.Event, deadline time.Instant) ui.Event{
        if deadline.is_zero() { << <- events}
        delay := deadline.since(time.instant())
        if delay.nanoseconds() <= 0 { << ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}}
        timer := delay.timer()
        select {event := <- events{timer.stop()
                << event}
            _ := <- timer.c{timer.stop()}}
        << ui.Event{kind: ui.EV_NONE, window_id: 0, menu_id: "", width: 0, height: 0}
    }
    
    fn workshop_loop(events chan ui.Event, model $&Workshop, screen $&widgets.Screen) int {
        model.apply_locale(screen) or >>
        screen.set_text(model.title, "XUUI  /  Field") or >>
        model.configure_controls(screen) or >>
        model.controls_dirty = false
        model.apply_appearance(screen) or >>
        model.appearance_dirty = false
        $dispatcher := register_events(& * model, & * screen) or >>
        model.layout(screen) or >>
        while screen.is_open() {
            register_notice_events(& * screen, $&dispatcher) or >>
            now := time.instant()
            model.work(screen, now) or >>
            if model.controls_dirty{model.configure_controls(screen) or >>
                model.controls_dirty = false}
            if model.appearance_dirty{model.apply_appearance(screen) or >>
                model.appearance_dirty = false}
            model.apply_page_options(screen) or >>
            model.layout(screen) or >>
            $deadline := screen.advance(now) or >>
            $timed_actions := false
            for action in screen.take_actions() {
                _ := dispatcher.dispatch_or_fallback(&action, model, screen) or >>
                timed_actions = true
            }
            // Reconcile timer-driven values/styles before computing the next wait.
            if timed_actions{ -> }
            _ := screen.render() or >>
            if model.running &&(deadline.is_zero() || model.deadline.before(deadline)) {deadline = model.deadline}
            event := next_event(events, deadline) or >>
            $actions := screen.event(&event) or >>
            $count := 0
            while screen.is_open() && count < 128 {pending := ui.poll_chan(events)
                if pending.kind == ui.EV_NONE{ <- }
                more := screen.event(&pending) or >>
                for action in more{actions.push(action)}
                count += 1}
            for action in actions{register_notice_events(& * screen, $&dispatcher) or >>
                _ := dispatcher.dispatch_or_fallback(&action, model, screen) or >> }
        }
        << 0
    }
    Xuevents.xu
    @main
    
    #ui/widgets
    #time
    #math
    
    // Each control ID has one owner-specific handler. No page-number update switch.
    fn register_events(m &Workshop, s &widgets.Screen) widgets.ActionDispatcher#Workshop, widgets.Screen, widgets.Action{
        $d := widgets.action_dispatcher(m, s)
        for page in m.pages{for id in page.ids{d.on_any(id, sample_action) or >> }}
        d.on(m.navigation, widgets.ACTION_CHANGE, navigate) or >>
        d.on(m.language, widgets.ACTION_CHANGE, language_changed) or >>
        for id in[m.theme, m.density, m.scale, m.reduced] {d.on(id, widgets.ACTION_CHANGE, appearance_changed) or >> }
        d.on(m.state, widgets.ACTION_CHANGE, state_changed) or >>
        d.on(m.custom, widgets.ACTION_ACTIVATE, custom_clicked) or >>
        d.on(m.motion, widgets.ACTION_ACTIVATE, motion_clicked) or >>
        d.on(m.focus, widgets.ACTION_ACTIVATE, focus_clicked) or >>
        for id in m.tools{d.on(id, widgets.ACTION_ACTIVATE, tool_clicked) or >> }
        for i in 0:4 {d.on(m.pages[1].ids[9 + i], widgets.ACTION_CHANGE, appearance_changed) or >> }
        d.on(m.pages[7].ids[1], widgets.ACTION_CHANGE, tree_filter_changed) or >>
        d.on(m.pages[7].ids[0], widgets.ACTION_ITEM_ACTION, node_action) or >>
        d.on(m.pages[8].ids[0], widgets.ACTION_ACTIVATE, task_clicked) or >>
        for kind in[widgets.ACTION_CHANGE, widgets.ACTION_COMMIT] {
            d.on(m.pages[13].ids[0], kind, slider_changed) or >>
            d.on(m.pages[20].ids[0], kind, color_changed) or >>
            d.on(m.pages[40].ids[0], kind, range_changed) or >>
        }
        d.on(m.pages[17].ids[1], widgets.ACTION_CHANGE, multi_filter_changed) or >>
        d.on(m.pages[24].ids[0], widgets.ACTION_ACTIVATE, table_sorted) or >>
        d.on(m.pages[25].ids[0], widgets.ACTION_CHANGE, pagination_changed) or >>
        d.on(m.pages[25].ids[2], widgets.ACTION_CHANGE, page_size_changed) or >>
        for kind in[widgets.ACTION_SUBMIT, widgets.ACTION_COMMIT] {d.on(m.pages[25].ids[1], kind, page_submitted) or >> }
        d.on(m.pages[25].ids[4], widgets.ACTION_ACTIVATE, page_submitted) or >>
        d.on(m.pages[30].ids[1], widgets.ACTION_ACTIVATE, inbox_clicked) or >>
        d.on(m.pages[30].ids[2], widgets.ACTION_ACTIVATE, online_clicked) or >>
        d.on(m.pages[33].ids[0], widgets.ACTION_ACTIVATE, preferences_open) or >>
        d.on(m.pages[33].ids[6], widgets.ACTION_ACTIVATE, preferences_cancel) or >>
        d.on(m.pages[33].ids[7], widgets.ACTION_ACTIVATE, preferences_apply) or >>
        d.on(m.pages[35].ids[0], widgets.ACTION_ACTIVATE, notice_clicked) or >>
        d.on(m.pages[36].ids[0], widgets.ACTION_ACTIVATE, modal_open) or >>
        for i in 2:4 {d.on(m.pages[36].ids[i], widgets.ACTION_ACTIVATE, modal_close) or >> }
        for id in m.pages[38].ids{for kind in[widgets.ACTION_ACTIVATE, widgets.ACTION_CHANGE] {d.on(id, kind, group_changed) or >> }}
        for r in 1:7 {d.on(m.pages[39].ids[r], widgets.ACTION_CHANGE, chart_kind_changed) or >> }
        for kind in[widgets.ACTION_CHART_HOVER, widgets.ACTION_CHART_SELECT] {d.on(m.pages[39].ids[0], kind, chart_hit) or >> }
        d.on(m.pages[39].ids[0], widgets.ACTION_CHART_VIEWPORT, chart_viewport_changed) or >>
        d.on(m.pages[41].ids[0], widgets.ACTION_COMMIT, split_committed) or >>
        for page in 42:45 {for kind in[widgets.ACTION_ACTIVATE, widgets.ACTION_CHANGE] {d.on(m.pages[page].ids[0], kind, menu_action) or >> }}
        d.on(m.pages[45].ids[1], widgets.ACTION_CHANGE, password_visibility_changed) or >>
        for kind in[widgets.ACTION_WEB_LOADING, widgets.ACTION_WEB_LOADED, widgets.ACTION_WEB_FAILED, widgets.ACTION_WEB_PROGRESS] {
            d.on(m.pages[37].ids[0], kind, webview_changed) or >>
        }
        << d
    }
    fn register_notice_events(s &widgets.Screen, d $&widgets.ActionDispatcher#Workshop, widgets.Screen, widgets.Action) int {
        for id in s.notice_ids() {d.on(id, widgets.ACTION_NOTICE_ACTION, notice_action) or >> }
        << 0
    }
    // Adapters catch Xu errors before crossing the function-value ABI.
    fn sample_action(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        sample_action_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn navigate(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        navigate_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn language_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        language_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn appearance_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        appearance_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn custom_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        custom_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn motion_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        motion_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn focus_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        focus_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn tree_filter_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        tree_filter_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn multi_filter_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        multi_filter_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn slider_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        slider_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn color_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        color_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn pagination_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        pagination_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn page_size_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        page_size_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn page_submitted(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        page_submitted_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn task_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        task_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn inbox_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        inbox_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn online_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        online_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn preferences_open(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        preferences_open_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn preferences_cancel(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        preferences_cancel_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn preferences_apply(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        preferences_apply_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn notice_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        notice_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn notice_action(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        notice_action_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn modal_open(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        modal_open_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn modal_close(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        modal_close_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn group_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        group_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn chart_kind_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        chart_kind_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn chart_hit(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        chart_hit_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn chart_viewport_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        chart_viewport_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn range_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        range_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn split_committed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        split_committed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn menu_action(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        menu_action_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn password_visibility_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        password_visibility_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn table_sorted(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        table_sorted_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn node_action(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        node_action_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn webview_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        webview_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn state_changed(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        state_changed_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn sample_action_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        if a.kind == widgets.ACTION_COMMIT{s.set_text(m.status, "Committed value · " + str(int(a.value))) or >> }
        if a.kind == widgets.ACTION_ACTIVATE{s.set_text(m.status, "Activated / 已激活 · control " + str(a.id)) or >> }
        << 0
    }
    fn navigate_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        old := m.page_snapshot(m.selected)
        if m.selected == 33 || m.selected == 36 {s.close_overlay(old.ids[1]) or >> }
        m.controls_dirty = true
        m.selected = s.selected(m.navigation) or >>
        s.set_scroll_offset(m.preview, 0.0) or >>
        m.appearance_dirty = true
        << 0
    }
    fn language_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int { << m.apply_locale(s) or >> }
    fn appearance_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {m.appearance_dirty = true
        << 0}
    fn custom_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {m.customized = !m.customized
        m.controls_dirty = true
        m.appearance_dirty = true
        << 0}
    fn motion_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {m.slow = !m.slow
        m.controls_dirty = true
        m.appearance_dirty = true
        << 0}
    fn focus_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        page := m.page_snapshot(m.selected)
        $target := page.ids[0]
        if m.selected == 31 {target = page.ids[6]}
        s.focus(target) or >>
        << 0
    }
    fn tree_filter_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        s.set_tree_filter(m.pages[7].ids[0], s.text_value(a.id) or >>) or >>
        << 0
    }
    fn multi_filter_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        s.set_multi_filter(m.pages[17].ids[0], s.text_value(a.id) or >>) or >>
        << 0
    }
    fn slider_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        s.set_value(m.pages[13].ids[1], str(int(a.value))) or >>
        << sample_action_update(m, s, a) or >>
    }
    fn color_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        s.set_value(m.pages[20].ids[1], s.color_hex(a.id) or >>) or >>
        s.set_field_invalid(m.pages[20].ids[1], false) or >>
        << sample_action_update(m, s, a) or >>
    }
    fn pagination_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int { << m.update_pagination(s, true) or >> }
    fn page_size_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        page := m.page_snapshot(25)
        data := s.pagination_data(page.ids[0]) or >>
        sizes :=[10, 20, 50, 100]
        s.set_pagination_data(page.ids[0], max_int_local(0, data.total), sizes[s.selected(a.id) or >>]) or >>
        << m.update_pagination(s, true) or >>
    }
    fn page_submitted_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int { << tool_25_update(m, s, 0) or >> }
    fn task_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        if m.running{ << 0}
        m.revision += 1
        m.completed = 0
        m.checksum = 0
        m.running = true
        m.deadline = time.instant()
        s.begin_task(a.id, m.revision) or >>
        << 0
    }
    fn inbox_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {m.unread = 0
        << m.update_badges(s) or >> }
    fn online_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {m.online = !m.online
        << m.update_badges(s) or >> }
    fn preferences_open_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int { << m.open_preferences(s) or >> }
    fn preferences_cancel_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.close_overlay(m.pages[33].ids[1]) or >>
        << 0}
    fn preferences_apply_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        page := m.page_snapshot(33)
        name := s.text_value(page.ids[4]) or >>
        if name.len == 0 {s.set_field_invalid(page.ids[4], true) or >>
            << 0}
        s.set_field_invalid(page.ids[4], false) or >>
        $history := "off"
        if s.toggle_value(page.ids[5]) or >> {history = "on"}
        m.preferences_name = name
        m.preferences_history = s.toggle_value(page.ids[5]) or >>
        s.set_text(page.ids[8], "Current: " + m.preferences_name + " · history " + history) or >>
        s.close_overlay(page.ids[1]) or >>
        << 0
    }
    fn notice_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int { << tool_35_update(m, s, 0) or >> }
    fn notice_action_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.set_text(m.status, "Undo requested · business state can now be restored.") or >>
        << 0}
    fn modal_open_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.open(m.pages[36].ids[1]) or >>
        << 0}
    fn modal_close_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.close_overlay(m.pages[36].ids[1]) or >>
        << 0}
    fn group_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        values := s.button_group_values(a.id) or >>
        s.set_text(m.status, "ButtonGroup · key " + str(int(a.value)) + " · selected " + str(values.len)) or >>
        << 0
    }
    fn chart_kind_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        m.controls_dirty = true
        m.chart_kind = int(a.value) - 1
        english := (s.selected(m.language) or >>) == 1
        series := chart_data_locale(m.chart_kind, m.revision, english)
        s.set_chart_series(m.pages[39].ids[0], &series) or >>
        s.reset_chart_viewport(m.pages[39].ids[0]) or >>
        m.appearance_dirty = true
        << 0
    }
    fn chart_hit_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        $hit := s.chart_hovered(a.id) or >>
        if a.kind == widgets.ACTION_CHART_SELECT{hit = s.chart_selection(a.id) or >> }
        if hit.valid{s.set_text(m.status, "Series " + str(hit.series_id) + " / point " + str(hit.point_id) + " · " + str(int(hit.y))) or >> }
        << 0
    }
    fn chart_viewport_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.set_text(m.status, "Viewport updated · Double click / Home to reset") or >>
        << 0}
    fn range_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int { << m.range_summary(s, a.kind == widgets.ACTION_COMMIT) or >> }
    fn split_committed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.set_text(m.status, "Split ratio / 分栏比例 · " + str(int(math.round(a.value * 100.0))) + "%") or >>
        << 0}
    fn menu_action_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        for index in 42:45 {page := m.page_snapshot(index)
            if page.ids[0] == a.id{s.set_text(page.ids[1], "Action / 操作 · " + str(int(a.value))) or >> }}
        << 0
    }
    fn password_visibility_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.set_password_visible(m.pages[45].ids[0], s.toggle_value(a.id) or >>) or >>
        << 0}
    fn table_sorted_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        $direction := "ascending / 升序"
        if s.sort_descending(a.id) or >> {direction = "descending / 降序"}
        selected := s.table_selected_row(a.id) or >>
        s.set_text(m.status, "Sorted / 已排序 · " + direction + " · source row " + str(selected)) or >>
        << 0
    }
    fn node_action_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {s.set_text(m.status, "Node action · " + str(int(a.value))) or >>
        << 0}
    fn webview_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        if m.selected != 37 { << 0}s.set_text(m.status, "WebView · event " + str(a.kind) + " · " + str(int(a.value))) or >>
        << 0}
    
    fn state_changed_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        m.controls_dirty = true
        << 0
    }
    Xuevents_tools.xu
    @main
    
    #ui/widgets
    #ui/webview
    #time
    #math
    #errors
    #strconv
    
    fn tool_0_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(0)
        id := page.ids[0]
        $text := "精密 · 清晰 · 可靠。"
        if option == 0 {text = "长中文:输入、选择、复制与原生排版保持一致。Long English text wraps inside its content width. Family 👨‍👩‍👧‍👦 and developer 👩🏽‍💻 remain intact."}
        s.set_text(id, text) or >>
        << 0
    }
    
    fn tool_1_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(1)
        id := page.ids[0]
        s.set_selected_button(id, option == 0) or >>
        << 0
    }
    
    fn tool_2_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(2)
        id := page.ids[0]
        s.set_selected_button(id, option == 0) or >>
        << 0
    }
    
    fn tool_3_update(m $&Workshop, s $&widgets.Screen, option int) int {
        index := 3
        page := m.page_snapshot(3)
        id := page.ids[0]
        if option == 0 {s.set_value(id, "") or >> }
        if option == 1 {$value := "Long text · 很长的中文与 English · 👩🏽‍💻 🙂 abcdefghijklmnopqrstuvwxyz"
            if index == 4 || index == 6 {value = value + "\n第二行\n第三行\n第四行\n第五行\n第六行\n第七行:内部滚动"}
            s.set_value(id, value) or >> }
        << 0
    }
    
    fn tool_4_update(m $&Workshop, s $&widgets.Screen, option int) int {
        index := 4
        page := m.page_snapshot(4)
        id := page.ids[0]
        if option == 0 {s.set_value(id, "") or >> }
        if option == 1 {$value := "Long text · 很长的中文与 English · 👩🏽‍💻 🙂 abcdefghijklmnopqrstuvwxyz"
            if index == 4 || index == 6 {value = value + "\n第二行\n第三行\n第四行\n第五行\n第六行\n第七行:内部滚动"}
            s.set_value(id, value) or >> }
        << 0
    }
    
    fn tool_5_update(m $&Workshop, s $&widgets.Screen, option int) int {
        index := 5
        page := m.page_snapshot(5)
        id := page.ids[0]
        if option == 0 {s.set_value(id, "") or >> }
        if option == 1 {$value := "Long text · 很长的中文与 English · 👩🏽‍💻 🙂 abcdefghijklmnopqrstuvwxyz"
            if index == 4 || index == 6 {value = value + "\n第二行\n第三行\n第四行\n第五行\n第六行\n第七行:内部滚动"}
            s.set_value(id, value) or >> }
        if option == 2 && index >= 5 {m.field_options_dirty = true
            m.field_options_page = index
            m.variant += 1}
        << 0
    }
    
    fn tool_6_update(m $&Workshop, s $&widgets.Screen, option int) int {
        index := 6
        page := m.page_snapshot(6)
        id := page.ids[0]
        if option == 0 {s.set_value(id, "") or >> }
        if option == 1 {$value := "Long text · 很长的中文与 English · 👩🏽‍💻 🙂 abcdefghijklmnopqrstuvwxyz"
            if index == 4 || index == 6 {value = value + "\n第二行\n第三行\n第四行\n第五行\n第六行\n第七行:内部滚动"}
            s.set_value(id, value) or >> }
        if option == 2 && index >= 5 {m.field_options_dirty = true
            m.field_options_page = index
            m.variant += 1}
        << 0
    }
    
    fn tool_7_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(7)
        id := page.ids[0]
        if option == 0 {m.guided = !m.guided
            m.tree_options_dirty = true}
        if option == 1 {s.set_selected(id, 7) or >>
            s.focus(id) or >> }
        if option == 2 {s.set_value(page.ids[1], "") or >>
            s.set_tree_filter(id, "") or >> }
        << 0
    }
    
    fn tool_8_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(8)
        id := page.ids[0]
        if option == 0 {m.variant += 1
            s.set_task_progress_mode(id, m.variant % 3) or >> }
        if option == 1 {m.failure = !m.failure
            s.set_selected_button(m.tools[1], m.failure) or >> }
        if option == 2 && m.running{_ := s.complete_task(id, m.revision, widgets.TASK_CANCELLED) or >>
            m.running = false}
        << 0
    }
    
    fn tool_9_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(9)
        id := page.ids[0]
        s.set_checkbox_indeterminate(id, option == 0) or >>
        if option > 0 {s.set_toggle_value(id, option == 1) or >> }
        << 0
    }
    
    fn tool_10_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(10)
        id := page.ids[0]
        if option == 0 {m.pending_before = s.toggle_value(id) or >>
            s.set_switch_pending(id, true) or >>
            s.set_text(id, "Live preview · Saving…") or >> }
        else {s.set_switch_pending(id, false) or >>
            s.set_toggle_value(id, option == 1 || m.pending_before) or >>
            s.set_invalid(id, option == 2) or >>
            s.set_text(id, "Live preview 实时预览") or >> }
        << 0
    }
    
    fn tool_11_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(11)
        id := page.ids[0]
        s.set_toggle_value(id, option == 0) or >>
        << 0
    }
    
    fn tool_13_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(13)
        id := page.ids[0]
        if option > 0 {s.set_slider_commit_only(id, option == 1) or >> }
        else {text := s.text_value(page.ids[1]) or >>
            value := strconv.parse_float(&text) or(err) {s.set_field_invalid(page.ids[1], true) or >>
                << 0}
            if math.is_nan(value) || math.is_inf(value) || value < 0.0 || value > 100.0 {s.set_field_invalid(page.ids[1], true) or >>
                << 0}
            s.set_number_value(id, value) or >>
            s.set_field_invalid(page.ids[1], false) or >> }
        << 0
    }
    
    fn tool_15_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(15)
        id := page.ids[0]
        if option == 0 {s.set_candidate_open(id, true) or >> }
        else {s.set_select_option_enabled(id, 2, false) or >> }
        << 0
    }
    
    fn tool_16_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(16)
        id := page.ids[0]
        if option < 2 {s.set_combo_custom_values(id, option == 0) or >> }
        else {s.set_value(id, "") or >> }
        << 0
    }
    
    fn tool_17_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(17)
        id := page.ids[0]
        s.select_all(id, option == 0) or >>
        << 0
    }
    
    fn tool_18_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(18)
        id := page.ids[0]
        if option == 0 {s.clear_calendar(id) or >> }
        else {value := time.date(2026, 10, 25, 0, 0, 0, 0)
            s.set_calendar_value(id, value) or >> }
        << 0
    }
    
    fn tool_19_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(19)
        id := page.ids[0]
        s.set_clock_format(id, option == 0, option != 2) or >>
        << 0
    }
    
    fn tool_20_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(20)
        id := page.ids[0]
        $value := "#B4392DFF"
        if option == 0 {value = s.text_value(page.ids[1]) or >> }
        if option == 2 {value = "#3279A080"}
        s.set_color_hex(id, value) or(err) {s.set_field_invalid(page.ids[1], true) or >>
            s.set_text(m.status, err.msg()) or >>
            << 0}
        s.set_field_invalid(page.ids[1], false) or >>
        s.remember_color(id) or >>
        s.set_value(page.ids[1], s.color_hex(id) or >>) or >>
        << 0
    }
    
    fn tool_24_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(24)
        id := page.ids[0]
        s.set_table_status(id,["", "Loading workspace… 正在加载", "Unable to load. Retry when ready."][option]) or >>
        << 0
    }
    
    fn tool_25_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(25)
        id := page.ids[0]
        sizes :=[10, 20, 50, 100]
        size := sizes[s.selected(page.ids[2]) or >>]
        data := s.pagination_data(id) or >>
        if option == 2 {if data.total == 0 {s.set_pagination_data(id, 20000, size) or >> }
            else {s.set_pagination_data(id, 0, size) or >> }}
        else {
            if data.pages == 0 {m.pagination_invalid(s) or >>
                << 0}
            current := s.pagination_data(id) or >>
            $number := current.pages
            if option == 0 {text := s.text_value(page.ids[1]) or >>
                number = strconv.atoi(&text) or(err) {m.pagination_invalid(s) or >>
                    << 0}
                if number < 1 || number > current.pages{m.pagination_invalid(s) or >>
                    << 0}}
            s.set_selected(id, number - 1) or >>
            s.set_field_invalid(page.ids[1], false) or >>
        }
        m.update_pagination(s, true) or >>
        << 0
    }
    
    fn tool_27_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(27)
        id := page.ids[0]
        s.set_number_value(id,[0.0, 0.42, 1.0][option]) or >>
        << 0
    }
    
    fn tool_28_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(28)
        id := page.ids[0]
        if option < 2 {s.set_running(id, option == 0) or >> }
        else {m.spinner_options_dirty = true}
        << 0
    }
    
    fn tool_30_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(30)
        id := page.ids[0]
        if option == 0 {m.unread += 1}
        if option == 1 {m.unread = 0}
        if option == 2 {m.unread = 123}
        m.update_badges(s) or >>
        << 0
    }
    
    fn tool_32_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(32)
        id := page.ids[0]
        if option == 0 {s.set_scroll_offset(id, 0.0) or >> }
        if option == 1 {s.set_scroll_offset(id, 100000.0) or >> }
        if option == 2 {s.focus(page.ids[page.ids.len - 1]) or >> }
        << 0
    }
    
    fn tool_33_update(m $&Workshop, s $&widgets.Screen, option int) int {
        index := 33
        page := m.page_snapshot(33)
        id := page.ids[0]
        if option == 2 {m.variant =(m.variant + 1) % 4
            m.popover_options_dirty = true}
        if option == 0 {if index == 33 {m.open_preferences(s) or >> } else {s.open(page.ids[1]) or >> }}
        else if option == 1 {s.close_overlay(page.ids[1]) or >> }
        << 0
    }
    
    fn tool_34_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(34)
        id := page.ids[0]
        if option == 2 {m.tooltip_side =(m.tooltip_side + 1) % 4
            m.appearance_dirty = true
            s.focus(id) or >>
            s.set_text(m.status, "Tooltip · " +["Bottom 下", "Top 上", "Left 左", "Right 右"][m.tooltip_side] + " · flips at the viewport edge") or >> }
        if option == 0 {s.focus(id) or >> }
        else if option == 1 {s.focus(0) or >> }
        << 0
    }
    
    fn tool_35_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(35)
        id := page.ids[0]
        $notice := widgets.notice(&"Workspace saved · 工作区已保存")
        notice.action = "Undo"
        notice.key = "workspace-save"
        if option == 1 {notice.text = "Changes restored · 已撤销"
            notice.key = "workspace-undo"}
        $count := 1
        if option == 2 {count = 3}
        for i in 0:count{if count > 1 {notice.key = "notice-" + str(i)
                notice.text = "Queued notice " + str(i + 1)}
            _ := s.enqueue_notice(&notice) or >> }
        << 0
    }
    
    fn tool_36_update(m $&Workshop, s $&widgets.Screen, option int) int {
        index := 36
        page := m.page_snapshot(36)
        id := page.ids[0]
        if option == 0 {if index == 33 {m.open_preferences(s) or >> } else {s.open(page.ids[1]) or >> }}
        else if option == 1 {s.close_overlay(page.ids[1]) or >> }
        << 0
    }
    
    fn tool_37_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(37)
        id := page.ids[0]
        if option == 0 {native := s.webview_native(id) or >>
            client := webview.bind_native(&native) or >>
            client.command("reload") or >> }
        else {s.set_visible(id, option == 2) or >> }
        << 0
    }
    
    fn tool_38_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(38)
        id := page.ids[0]
        if option == 0 {m.group_disabled = !m.group_disabled
            m.controls_dirty = true}
        if option == 1 {m.group_vertical = !m.group_vertical}
        if option == 2 {m.group_joined = !m.group_joined}
        m.appearance_dirty = true
        << 0
    }
    
    fn tool_39_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(39)
        id := page.ids[0]
        if option == 0 {m.revision += 1
            english := (s.selected(m.language) or >>) == 1
            series := chart_data_locale(m.chart_kind, m.revision, english)
            s.set_chart_series(id, &series) or >>
            m.chart_paused = false}
        if option == 1 {s.reset_chart_viewport(id) or >> }
        if option == 2 {m.chart_paused = !m.chart_paused
            if m.chart_paused{s.pause_chart_animation(id) or >> }
            else {s.resume_chart_animation(id) or >> }}
        << 0
    }
    
    fn tool_40_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(40)
        id := page.ids[0]
        if option == 0 {m.range_push = !m.range_push}
        if option == 1 {m.range_commit = !m.range_commit}
        if option == 2 {m.range_vertical = !m.range_vertical}
        m.appearance_dirty = true
        m.range_summary(s, false) or >>
        << 0
    }
    
    fn tool_41_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(41)
        id := page.ids[0]
        if option == 0 {m.split_vertical = !m.split_vertical
            m.appearance_dirty = true}
        if option == 1 {m.split_collapsed =(s.split_layout(id) or >>).collapsed == 0
            s.set_split_collapsed(id, 0, m.split_collapsed) or >> }
        if option == 2 {m.split_collapsed = false
            s.set_split_ratio(id, 0.4) or >> }
        << 0
    }
    
    fn tool_42_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(42)
        id := page.ids[0]
        if option == 0 {s.focus(id) or >>
            s.set_menu_open(id, true) or >> }
        if option == 1 {m.menu_stays_open = !m.menu_stays_open
            m.appearance_dirty = true}
        if option == 2 {m.menu_export_disabled = !m.menu_export_disabled
            s.set_menu_item_enabled(id, 30, !m.menu_export_disabled) or >> }
        << 0
    }
    
    fn tool_43_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(43)
        id := page.ids[0]
        if option == 0 {s.focus(id) or >>
            s.set_menu_open(id, true) or >> }
        if option == 1 {m.menu_stays_open = !m.menu_stays_open
            m.appearance_dirty = true}
        if option == 2 {m.menu_export_disabled = !m.menu_export_disabled
            s.set_menu_item_enabled(id, 30, !m.menu_export_disabled) or >> }
        << 0
    }
    
    fn tool_44_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(44)
        id := page.ids[0]
        if option == 0 {s.focus(id) or >>
            s.set_menu_open(id, true) or >> }
        if option == 1 {m.menu_stays_open = !m.menu_stays_open
            m.appearance_dirty = true}
        if option == 2 {m.menu_export_disabled = !m.menu_export_disabled
            s.set_menu_item_enabled(id, 30, !m.menu_export_disabled) or >> }
        << 0
    }
    
    fn tool_45_update(m $&Workshop, s $&widgets.Screen, option int) int {
        page := m.page_snapshot(45)
        id := page.ids[0]
        if option == 0 {s.set_value(id, "") or >> }
        if option == 1 {s.set_value(id, "Xu-密码🙂") or >> }
        if option == 2 {s.focus(id) or >> }
        << 0
    }
    
    fn tool_none_update(m $&Workshop, s $&widgets.Screen, option int) int { << 0}
    
    fn tool_clicked_update(m $&Workshop, s $&widgets.Screen, a &widgets.Action) int {
        handlers :=[tool_0, tool_1, tool_2, tool_3, tool_4, tool_5, tool_6, tool_7, tool_8, tool_9, tool_10, tool_11, tool_none, tool_13, tool_none, tool_15, tool_16, tool_17, tool_18, tool_19, tool_20, tool_none, tool_none, tool_none, tool_24, tool_25, tool_none, tool_27, tool_28, tool_none, tool_30, tool_none, tool_32, tool_33, tool_34, tool_35, tool_36, tool_37, tool_38, tool_39, tool_40, tool_41, tool_42, tool_43, tool_44, tool_45]
        for i in 0:3 {if a.id == m.tools[i] {handler := handlers[m.selected]
                message := handler(m, s, i)
                if message.len > 0 { >> errors.new(message)}
                << 0}}
        << 0
    }
    
    fn tool_clicked(m $&Workshop, s $&widgets.Screen, a &widgets.Action) string {
        tool_clicked_update(m, s, a) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_0(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_0_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_1(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_1_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_2(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_2_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_3(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_3_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_4(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_4_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_5(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_5_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_6(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_6_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_7(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_7_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_8(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_8_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_9(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_9_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_10(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_10_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_11(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_11_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_13(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_13_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_15(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_15_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_16(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_16_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_17(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_17_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_18(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_18_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_19(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_19_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_20(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_20_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_24(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_24_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_25(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_25_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_27(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_27_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_28(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_28_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_30(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_30_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_32(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_32_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_33(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_33_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_34(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_34_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_35(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_35_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_36(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_36_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_37(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_37_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_38(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_38_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_39(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_39_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_40(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_40_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_41(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_41_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_42(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_42_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_43(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_43_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_44(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_44_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_45(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_45_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    
    fn tool_none(m $&Workshop, s $&widgets.Screen, option int) string {
        tool_none_update(m, s, option) or(err) { << err.msg()}
        << ""
    }
    Xulayout.xu
    @main
    
    #ui/widgets
    #ui/layout
    #math
    
    fn focusable_sample(index int) bool { << index != 0 && index != 27 && index != 28 && index != 29 && index != 30}
    
    fn (m &Workshop) layout(s $&widgets.Screen) int {
        styles := s.styles()
        scale := math.max(1.0, styles.text_scale)
        width := s.width()
        height := s.height()
        gap := 16.0
        rail := 216.0 + 40.0 *(scale - 1.0)
        x := rail + 48.0
        right := width - x - 24.0
        row := math.max(40.0 * styles.density, 36.0 * scale)
        s.place(m.title, 24.0, 20.0, width - 48.0, 36.0 * scale) or >>
        $top := 36.0 * scale + 32.0
        items :=[m.theme, m.density, m.scale, m.state]
        part :=(width - 48.0 - gap * 3.0) / 4.0
        for i in 0:4 {s.place(items[i], 24.0 + f64(i) *(part + gap), top, part, row) or >> }
        top += row + 12.0
        s.place(m.custom, 24.0, top, part, row) or >>
        s.place(m.motion, 24.0 + part + gap, top, part, row) or >>
        s.place(m.reduced, 24.0 +(part + gap) * 2.0, top, part, row) or >>
        s.place(m.focus, 24.0 +(part + gap) * 3.0, top, part, row) or >>
        top += row + 24.0
        s.place(m.navigation, 24.0, top, rail, height - top - row - 36.0) or >>
        s.place(m.language, 24.0, height - row - 24.0, rail, row) or >>
        s.place(m.caption, x, top, right, 58.0 * scale) or >>
        control_top := top + 66.0 * scale + 16.0
        content := math.max(100.0, right - 48.0)
        // Keep complete action labels at large text sizes. The toolbar shares the
        // preview's scroll area so wrapping never pushes the sample off the window.
        $columns := 3
        if content < 780.0 * scale{columns = 2}
        if content < 520.0 * scale{columns = 1}
        column :=(content - f64(columns - 1) * 12.0) / f64(columns)
        tool_names := tool_labels(m.selected)
        $tool_count := 0
        for i in 0:3 {if tool_names[i].len > 0 {
                s.place(m.tools[i], 24.0 + f64(tool_count % columns) *(column + 12.0), 24.0 + f64(tool_count / columns) *(row + 12.0), column, row) or >>
                tool_count += 1}}
        $tool_extent := 0.0
        if tool_count > 0 {tool_extent = f64((tool_count + columns - 1) / columns) *(row + 12.0) + 16.0}
        bottom := height - 56.0 * scale - 24.0
        s.place(m.preview, x, control_top, right, math.max(100.0, bottom - control_top)) or >>
        s.place(m.status, x, math.max(bottom + 12.0, control_top + 112.0), right, 52.0 * scale) or >>
        for i in 0:m.pages.len{s.set_visible(m.pages[i].group, i == m.selected) or >> }
        position := m.selected
        pages := &m.pages
        page := &pages[position]
        s.place(page.group, 0.0, tool_extent, right, 1000.0 * scale) or >>
        id := page.ids[0]
        $h := row
        if m.selected == 0 {h = 180.0 * scale}
        if m.selected == 4 {h = 220.0 * scale}
        if m.selected == 5 {h = 96.0 * scale}
        if m.selected == 6 {h = 210.0 * scale}
        if m.selected == 7 || m.selected == 23 || m.selected == 24 || m.selected == 32 || m.selected == 37 {h = 320.0 * scale}
        if m.selected == 12 {h = 144.0 * scale}
        if m.selected == 13 {h = 80.0 * scale}
        if m.selected == 20 {h = 280.0 * scale}
        if m.selected == 27 {h = 16.0 * scale}
        if m.selected == 28 {h = 54.0 * scale}
        if m.selected == 29 {h = 28.0 * scale}
        if m.selected == 30 {h = 320.0 * scale}
        if m.selected == 31 {h = 280.0 * scale}
        $y := 24.0
        if m.selected == 7 || m.selected == 17 {s.place(page.ids[1], 24.0, 24.0, content, 86.0 * scale) or >>
            y += 102.0 * scale}
        $sample_width := content
        if m.selected == 2 {sample_width = row
            h = row}
        if m.selected != 30 && m.selected != 1 {s.place(id, 24.0, y, sample_width, h) or >> }
        if m.selected == 1 {
            buttons := m.page_snapshot(1)
            h = layout_buttons(s, &buttons, content, row, scale) or >>
        }
        if m.selected == 34 {
            size := s.measure_button(id) or >>
            width := math.min(content, math.ceil(size.width))
            s.place(id, 24.0 +(content - width) * 0.5, y + 100.0 * scale, width, math.max(row, size.height)) or >>
            h = math.max(row, size.height) + 200.0 * scale
        }
        if m.selected == 0 {s.place(page.ids[1], 24.0, y + h + 16.0, content, 48.0 * scale) or >>
            h += 80.0 * scale}
        if m.selected == 13 {s.place(page.ids[1], 24.0, y + h + 24.0, content, 100.0 * scale) or >>
            h += 148.0 * scale}
        if m.selected == 25 {
            $summary_height := 28.0 * scale
            if content < 650.0 && scale > 1.4 {summary_height = 56.0 * scale}
            s.place(page.ids[3], 24.0, y, content, summary_height) or >>
            page_y := y + summary_height + 12.0 * scale
            s.place(id, 24.0, page_y, content, row) or >>
            cy := page_y + row + 28.0 * scale
            size_width := math.min(content, 150.0 * scale)
            input_width := 112.0 * scale
            go_width := 88.0 * scale
            $input_x := 40.0 + size_width
            $input_y := cy
            if size_width + input_width + go_width + 32.0 > content{
                input_x = 24.0
                input_y = cy + row + 32.0 * scale}
            s.place(page.ids[2], 24.0, cy, size_width, row) or >>
            s.place(page.ids[1], input_x, input_y - 8.0 * styles.density, input_width, row + 8.0 * styles.density) or >>
            s.place(page.ids[4], input_x + input_width + 16.0, input_y, go_width, row) or >>
            s.place(page.ids[5], 24.0, input_y + row + 12.0 * scale, content, 40.0 * scale) or >>
            h = input_y - y + row + 64.0 * scale
        }
        if m.selected == 33 {
            s.place(id, 24.0, y, math.min(content, 200.0 * scale), row) or >>
            s.place(page.ids[1], 0.0, 0.0, 360.0 * scale, 340.0 * scale) or >>
            s.place(page.ids[2], 24.0 * scale, 20.0 * scale, 312.0 * scale, 30.0 * scale) or >>
            s.place(page.ids[3], 24.0 * scale, 58.0 * scale, 312.0 * scale, 66.0 * scale) or >>
            s.place(page.ids[4], 24.0 * scale, 132.0 * scale, 312.0 * scale, 88.0 * scale) or >>
            s.place(page.ids[5], 24.0 * scale, 224.0 * scale, 312.0 * scale, row) or >>
            s.place(page.ids[6], 24.0 * scale, 280.0 * scale, 148.0 * scale, row) or >>
            s.place(page.ids[7], 188.0 * scale, 280.0 * scale, 148.0 * scale, row) or >>
            s.place(page.ids[8], 24.0, y + row + 20.0 * scale, content, 64.0 * scale) or >>
            h = row + 100.0 * scale
        }
        if m.selected == 20 {s.place(page.ids[1], 24.0, y + h + 24.0, content, 96.0 * scale) or >>
            h += 124.0 * scale}
        if m.selected == 28 || m.selected == 29 {s.place(page.ids[1], 24.0, y + h + 12.0, content, 36.0 * scale) or >>
            h += 60.0 * scale}
        if m.selected == 30 {
            button_width := math.min(content - 16.0, 220.0 * scale)
            s.place(page.ids[1], 24.0, y, button_width, row) or >>
            s.place(page.ids[6], 24.0, y + row + 14.0 * scale, content, 36.0 * scale) or >>
            ay := y + row + 78.0 * scale
            s.place(page.ids[2], 24.0, ay, 56.0 * scale, 56.0 * scale) or >>
            s.place(page.ids[7], 100.0 * scale, ay, math.max(1.0, content - 100.0 * scale), 32.0 * scale) or >>
            s.place(page.ids[8], 100.0 * scale, ay + 34.0 * scale, math.max(1.0, content - 100.0 * scale), 40.0 * scale) or >>
            sy := ay + 106.0 * scale
            tag := s.badge_size(page.ids[4]) or >>
            beta := s.badge_size(page.ids[5]) or >>
            label_width := 220.0 * scale
            $tx := 24.0
            $ty := sy + 44.0 * scale
            if label_width + tag.width + beta.width + 32.0 <= content{
                s.place(page.ids[9], 24.0, sy, label_width, 32.0 * scale) or >>
                tx = 40.0 + label_width
                ty = sy
            } else {s.place(page.ids[9], 24.0, sy, content, 32.0 * scale) or >> }
            s.place(page.ids[4], tx, ty, tag.width, tag.height) or >>
            s.place(page.ids[5], tx + 16.0 + tag.width, ty, beta.width, beta.height) or >>
            h = ty + math.max(tag.height, 32.0 * scale)
        }
        if m.selected == 31 {s.place(page.ids[4], 0.0, 0.0, content - 32.0, 36.0 * scale) or >>
            s.place(page.ids[5], 0.0, 0.0, content - 32.0, 110.0 * scale) or >>
            s.place(page.ids[6], 0.0, 0.0, content - 32.0, row) or >> }
        if m.selected == 32 {s.set_scroll_extent(id, 14.0 *(row + 16.0) + 24.0) or >>
            for i in 1:page.ids.len{s.place(page.ids[i], 12.0, 12.0 + f64(i - 1) *(row + 16.0), content - 44.0, row) or >> }}
        if m.selected == 38 {
            height := row
            $group_h := height
            if m.group_vertical{group_h = row * 3.0}
            $group_width := content
            if m.group_vertical{group_width = math.min(content, 260.0 * scale)}
            for i in 0:3 {cy := y + f64(i) *(group_h + 40.0 * scale)
                s.place(page.ids[3 + i], 24.0, cy, content, 24.0 * scale) or >>
                s.place(page.ids[i], 24.0, cy + 28.0 * scale, group_width, group_h) or >> }
            h = 3.0 *(group_h + 40.0 * scale)
        }
        if m.selected == 39 {
            $selector_h := row
            $selector := widgets.button_group_appearance()
            selector.equal_width = true
            selector.allow_empty = true
            if scale > 1.4 && content < 560.0 {selector.vertical = true
                selector_h = row * 5.0}
            $cy := y
            for r in 0:6 {
                gid := page.ids[1 + r]
                s.set_button_group_appearance(gid, &selector) or >>
                s.place(gid, 24.0, cy, content, selector_h) or >>
                cy += selector_h + 8.0 * scale
            }
            chart_y := cy + 12.0 * scale
            chart_h := math.max(320.0, 320.0 * scale)
            s.place(id, 24.0, chart_y, content, chart_h) or >>
            h = (chart_y - y) + chart_h + 20.0 * scale
        }
        if m.selected >= 40 {h = m.interaction_layout(s, row, scale, content) or >> }
        if m.selected == 36 {s.place(page.ids[2], 24.0 * scale, 190.0 * scale, 170.0 * scale, row) or >>
            s.place(page.ids[3], 210.0 * scale, 190.0 * scale, 170.0 * scale, row) or >> }
        s.set_scroll_extent(m.preview, tool_extent + y + h + 32.0) or >>
        << 0
    }
    
    fn layout_buttons(s $&widgets.Screen, page &Page, content f64, row f64, scale f64) f64 {
        stepper_width := math.min(content, 160.0 * scale)
        label_height := 24.0 * scale
        inspector_height := label_height + 8.0 + row + 12.0
        $cy := 24.0
        // Keep each direction pair together when it fits, then wrap by the native
        // measured size rather than stretching every example across the preview.
        for group in 0:2 {
            $x := 24.0
            $line_height := 0.0
            for i in(group * 2):(group * 2 + 2) {
                size := s.measure_button(page.ids[i]) or >>
                width := math.min(content, math.ceil(size.width))
                height := math.max(row, math.ceil(size.height))
                column := math.max(width, stepper_width)
                if x > 24.0 && x + column > 24.0 + content{
                    x = 24.0
                    cy += line_height + 12.0
                    line_height = 0.0
                }
                s.place(page.ids[13 + i], x, cy, column, label_height) or >>
                s.place(page.ids[9 + i], x, cy + label_height + 8.0, stepper_width, row) or >>
                s.place(page.ids[i], x, cy + inspector_height, width, height) or >>
                x += column + 16.0
                line_height = math.max(line_height, inspector_height + height)
            }
            cy += line_height + 20.0
        }
        $x := 24.0
        $line_height := 0.0
        for i in 4:9 {
            size := s.measure_button(page.ids[i]) or >>
            width := math.min(content, math.ceil(size.width))
            height := math.max(row, math.ceil(size.height))
            if x > 24.0 && x + width > 24.0 + content{
                x = 24.0
                cy += line_height + 12.0
                line_height = 0.0
            }
            s.place(page.ids[i], x, cy, width, height) or >>
            x += width + 12.0
            line_height = math.max(line_height, height)
        }
        cy += line_height + 20.0
        << cy - 24.0
    }
    
    fn (m &Workshop) interaction_layout(s $&widgets.Screen, row f64, scale f64, content f64) f64 {
        position := m.selected
        pages := &m.pages
        page := &pages[position]
        id := page.ids[0]
        if m.selected == 45 {
            width := math.min(content, 380.0 * scale)
            label_height := 28.0 * scale
            input_height := math.max(row, 48.0 * s.styles().density)
            input_y := 24.0 + label_height + 8.0
            s.place(page.ids[2], 24.0, 24.0, width, label_height) or >>
            s.place(id, 24.0, input_y, width, input_height) or >>
            s.place(page.ids[1], 24.0, input_y + input_height + 16.0, content, row) or >>
            s.place(page.ids[3], 24.0, input_y + input_height + row + 36.0, content, 100.0 * scale) or >>
            << label_height + input_height + row + 160.0 * scale
        }
        if m.selected == 40 {
            $width := content
            $height := 104.0 * scale
            if m.range_vertical{width = math.min(content, 160.0 * scale)
                height = 300.0 * scale}
            s.place(page.ids[1], 24.0, 24.0, content, 32.0 * scale) or >>
            s.place(id, 24.0, 64.0 * scale, width, height) or >>
            s.place(page.ids[2], 24.0, 80.0 * scale + height, content, 64.0 * scale) or >>
            << height + 144.0 * scale
        }
        if m.selected == 41 {
            height := 320.0 * scale
            s.place(id, 24.0, 24.0, content, height) or >>
            boxes := s.split_layout(id) or >>
            for pane in 0:2 {
                $width := boxes.first.width
                $height := boxes.first.height
                if pane == 1 {width = boxes.second.width
                    height = boxes.second.height}
                inner := math.max(1.0, width - 32.0)
                caption_height := math.max(1.0, math.min(100.0 * scale, height - row - 48.0))
                s.place(page.ids[3 + pane], 16.0, 16.0, inner, caption_height) or >>
                s.set_visible(page.ids[5 + pane], height >= row + 32.0) or >>
                s.place(page.ids[5 + pane], 16.0, math.max(16.0, height - row - 16.0), inner, row) or >>
            }
            << height
        }
        if m.selected >= 42 && m.selected <= 44 {
            $width := math.min(content, 240.0 * scale)
            $height := row
            if m.selected == 43 {width = content
                height = 180.0 * scale}
            s.place(id, 24.0, 24.0, width, height) or >>
            s.place(page.ids[1], 24.0, height + 44.0 * scale, content, 44.0 * scale) or >>
            s.place(page.ids[2], 24.0, height + 100.0 * scale, content, 80.0 * scale) or >>
            << height + 180.0 * scale
        }
        << row
    }
    Xumodel.xu
    @main
    
    #ui/widgets
    #time
    #strconv
    
    struct Page{group int
        ids []int}
    // A state transition may reconfigure Workshop while these control IDs are in
    // use. Copy the IDs; Screen keeps ownership of the actual controls.
    
    fn (m &Workshop) page_snapshot(index int) Page{
        group := m.pages[index].group
        $ids :=[]int {}
        for id in m.pages[index].ids{ids.push(id)}
        << Page{group: group, ids: ids}
    }
    
    struct Workshop{
        controls_dirty bool
        field_options_page int
        appearance_dirty bool
        tree_options_dirty bool
        field_options_dirty bool
        spinner_options_dirty bool
        popover_options_dirty bool
        tooltip_side int
        range_push bool
        range_vertical bool
        range_commit bool
        split_vertical bool
        split_collapsed bool
        menu_stays_open bool
        menu_export_disabled bool
        chart_kind int
        chart_paused bool
        group_vertical bool
        group_joined bool
        group_disabled bool
        pages []Page
        names []string
        navigation int
        language int
        preview int
        title int
        caption int
        status int
        theme int
        density int
        scale int
        state int
        custom int
        reduced int
        motion int
        focus int
        tools []int
        selected int
        customized bool
        guided bool
        slow bool
        variant int
        revision int
        completed int
        running bool
        failure bool
        pending_before bool
        pagination_error bool
        preferences_name string
        preferences_history bool
        unread int
        online bool
        checksum int
        deadline time.Instant
    }
    
    fn create(s $&widgets.Screen) Workshop{
        labels := names()
        $pages :=[]Page{}
        preview := s.scroll_area(widgets.AXIS_VERTICAL, 760.0) or >>
        for index in 0:labels.len{page := new_page(s, index) or >>
            s.set_parent(page.group, preview) or >>
            pages.push(page)}
        title := s.label("", 25.0, false) or >>
        caption := s.label("", 13.0, true) or >>
        s.set_label_wrapped(caption, true) or >>
        status := s.label("Hover · press · Tab · arrows · Escape / 使用真实鼠标与键盘状态", 12.0, true) or >>
        s.set_label_wrapped(status, true) or >>
        navigation := s.list_box(&labels, 5) or >>
        language := s.select_box(&["中文", "English", "Custom"], 1) or >>
        _ := s.tooltip(language, "Component language · 组件默认文案与格式") or >>
        tools :=[s.button("Option 1") or >>, s.button("Option 2") or >>, s.button("Option 3") or >>]
        for tool in tools{s.set_parent(tool, preview) or >> }
        << Workshop{controls_dirty: true, field_options_page: 5, appearance_dirty: true, tree_options_dirty: false, field_options_dirty: false, spinner_options_dirty: false, popover_options_dirty: false, tooltip_side: widgets.OVERLAY_TOP, range_push: false, range_vertical: false, range_commit: false, split_vertical: false, split_collapsed: false, menu_stays_open: false, menu_export_disabled: false, chart_kind: 0, chart_paused: false, group_vertical: false, group_joined: true, group_disabled: false, language: language, pages: pages, names: labels, navigation: navigation, preview: preview, title: title, caption: caption, status: status,
            theme: s.select_box(&["Light 亮色", "Dark 暗色", "Contrast 对比"], 1) or >>,
            density: s.select_box(&["Normal 常规", "Compact 紧凑", "Touch 触控"], 0) or >>,
            scale: s.select_box(&["Text 100%", "Text 140%", "Text 200%"], 0) or >>,
            state: s.select_box(&["Normal 普通", "Disabled 禁用", "Read only 只读", "Invalid 错误"], 0) or >>,
            custom: s.button("Default 默认") or >>, reduced: s.checkbox("Reduce 减少动效", false) or >>,
            motion: s.button("Motion 160ms") or >>, focus: s.button("Focus sample") or >>,
            tools: tools, selected: 5, customized: false, guided: true, slow: false,
            variant: 0, revision: 0, completed: 0, running: false, failure: false, pending_before: false, pagination_error: false, preferences_name: "XU workspace", preferences_history: true, unread: 12, online: true, checksum: 0, deadline: time.zero_instant()}
    }
    
    fn (m $&Workshop) apply_locale(s $&widgets.Screen) int {
        index := s.selected(m.language) or >>
        $locale := widgets.locale_en_us()
        if index != 1 {locale = widgets.locale_zh_cn()}
        if index == 2 {
            locale.set_text(widgets.TEXT_TODAY, "回到今天") or >>
            locale.set_text(widgets.TEXT_CLEAR, "移除日期") or >>
            locale.set_text(widgets.TEXT_DATE_PLACEHOLDER, "预约日期") or >>
            locale.set_text(widgets.TEXT_DATE_PATTERN, "{day}.{month}.{year}") or >>
            locale.set_text(widgets.TEXT_DECIMAL_SEPARATOR, ",") or >>
            locale.set_text(widgets.TEXT_GROUP_SEPARATOR, " ") or >>
            locale.set_weekdays(&["周日", "周一", "周二", "周三", "周四", "周五", "周六"]) or >>
        }
        s.set_locale(&locale) or >>
        pages := &m.pages
        pagination := &pages[25]
        sizes :=[10, 20, 50, 100]
        for i in 0:4 {s.set_option_text(pagination.ids[2], i, locale.count_text(widgets.TEXT_ITEMS_PER_PAGE, sizes[i]) or >>) or >> }
        m.update_pagination(s, false) or >>
        // Business copy is supplied by the app, never silently translated by the widget.
        english := index == 1
        m.names = names_locale(english)
        for i in 0:m.names.len {s.set_option_text(m.navigation, i, m.names[i]) or >> }
        $themes :=["亮色", "暗色", "高对比"]
        $densities :=["常规", "紧凑", "触控"]
        $scales :=["字号 100%", "字号 140%", "字号 200%"]
        $states :=["普通", "禁用", "只读", "错误"]
        $choices :=["工作区", "历史", "输出"]
        $segments :=["日", "周", "月"]
        $group_titles :=["独立操作", "单选", "多选"]
        $btn_samples :=["构建项目", "打开工作区 · 右侧图标", "保存修改 · 上方图标", "下载 SDK · 下方图标", "次要按钮", "描边按钮", "幽灵按钮", "危险操作", "轻量按钮"]
        $overlay_triggers :=["打开浮层", "聚焦或悬停查看帮助", "发送通知", "打开确认弹窗"]
        if english{
            themes =["Light", "Dark", "Contrast"]
            densities =["Normal", "Compact", "Touch"]
            scales =["Text 100%", "Text 140%", "Text 200%"]
            states =["Normal", "Disabled", "Read only", "Invalid"]
            choices =["Workspace", "History", "Output"]
            segments =["Day", "Week", "Month"]
            group_titles =["Actions", "Single", "Multiple"]
            btn_samples =["Build project", "Open workspace · trailing", "Save changes · above", "Download SDK · below", "Secondary", "Outline", "Ghost", "Danger", "Subtle"]
            overlay_triggers =["Open popover", "Focus or hover for help", "Enqueue notification", "Open confirmation"]
        }
        for i in 0:9 {s.set_text(m.pages[1].ids[i], btn_samples[i]) or >> }
        for i in 0:4 {s.set_text(m.pages[33 + i].ids[0], overlay_triggers[i]) or >> }
        for i in 0:3 {
            s.set_option_text(m.theme, i, themes[i]) or >>
            s.set_option_text(m.density, i, densities[i]) or >>
            s.set_option_text(m.scale, i, scales[i]) or >>
            s.set_option_text(m.pages[21].ids[0], i, choices[i]) or >>
            s.set_option_text(m.pages[22].ids[0], i, segments[i]) or >>
            s.set_text(m.pages[38].ids[3 + i], group_titles[i]) or >>
        }
        for i in 0:4 {s.set_option_text(m.state, i, states[i]) or >> }
        page := &m.pages[8]
        if english {
            s.set_text(page.ids[0], "Build project") or >>
            s.set_task_labels(page.ids[0], "Building", "Built · run again", "Retry build", "Build again") or >>
            s.set_text(m.reduced, "Reduce motion") or >>
            s.set_text(m.focus, "Focus sample") or >>
            s.set_text(m.pages[9].ids[0], "Keep generated files") or >>
            s.set_text(m.pages[10].ids[0], "Live preview") or >>
            s.set_text(m.pages[11].ids[0], "Use workspace settings") or >>
            s.set_text(m.pages[25].ids[4], "Go") or >>
            s.set_text(m.pages[28].ids[1], "Loading assets…") or >>
            s.set_text(m.pages[29].ids[1], "SECTION") or >>
            s.set_text(m.pages[30].ids[1], "Inbox") or >>
            s.set_text(m.pages[30].ids[4], "Synced") or >>
            s.set_text(m.pages[30].ids[9], "Workspace") or >>
            s.set_text(m.pages[31].ids[4], "Workspace configuration") or >>
            s.set_text(m.pages[31].ids[6], "Open workspace") or >>
            s.set_text(m.pages[33].ids[2], "Workspace preferences") or >>
            s.set_text(m.pages[33].ids[5], "Keep history") or >>
            s.set_text(m.pages[33].ids[6], "Cancel") or >>
            s.set_text(m.pages[33].ids[7], "Apply") or >>
            s.set_text(m.pages[36].ids[2], "Cancel") or >>
            s.set_text(m.pages[36].ids[3], "Apply changes") or >>
            s.set_text(m.pages[41].ids[5], "Open workspace") or >>
            s.set_text(m.pages[41].ids[6], "Refresh preview") or >>
            s.set_text(m.pages[45].ids[1], "Show password") or >>
            s.set_text(m.pages[45].ids[2], "Password") or >>
        } else {
            s.set_text(page.ids[0], "构建项目") or >>
            s.set_task_labels(page.ids[0], "正在构建", "已构建 · 再次运行", "重试构建", "再次构建") or >>
            s.set_text(m.reduced, "减少动效") or >>
            s.set_text(m.focus, "聚焦示例") or >>
            s.set_text(m.pages[9].ids[0], "保留生成产物") or >>
            s.set_text(m.pages[10].ids[0], "实时预览") or >>
            s.set_text(m.pages[11].ids[0], "使用工作区设置") or >>
            s.set_text(m.pages[25].ids[4], "跳转") or >>
            s.set_text(m.pages[28].ids[1], "正在加载资源…") or >>
            s.set_text(m.pages[29].ids[1], "章节分隔") or >>
            s.set_text(m.pages[30].ids[1], "收件箱") or >>
            s.set_text(m.pages[30].ids[4], "已同步") or >>
            s.set_text(m.pages[30].ids[9], "工作区") or >>
            s.set_text(m.pages[31].ids[4], "工作区配置") or >>
            s.set_text(m.pages[31].ids[6], "打开工作区") or >>
            s.set_text(m.pages[33].ids[2], "工作区偏好设置") or >>
            s.set_text(m.pages[33].ids[5], "保留历史记录") or >>
            s.set_text(m.pages[33].ids[6], "取消") or >>
            s.set_text(m.pages[33].ids[7], "应用") or >>
            s.set_text(m.pages[36].ids[2], "取消") or >>
            s.set_text(m.pages[36].ids[3], "应用更改") or >>
            s.set_text(m.pages[41].ids[5], "打开工作区") or >>
            s.set_text(m.pages[41].ids[6], "刷新预览") or >>
            s.set_text(m.pages[45].ids[1], "显示密码") or >>
            s.set_text(m.pages[45].ids[2], "密码") or >>
        }
        m.update_badges(s) or >>
        m.range_summary(s, false) or >>
        m.appearance_dirty = true
        $group_labels :=[["Undo", "Redo", "Save"],["Day", "Week", "Month"],["Bold", "Italic", "Underline"]]
        $type_labels :=["Line", "Area", "Bar", "Scatter", "Donut",
            "Step", "StackArea", "StackBar", "H-Bar", "Pie",
            "Rose", "Radar", "Gauge", "Bubble", "Histogram",
            "Boxplot", "Heatmap", "Candle", "Waterfall", "Funnel",
            "Spline", "SplineArea", "PolarBar", "Treemap", "Sankey",
            "Violin", "Bullet", "Lollipop", "Dumbbell", "Pareto"]
        if !english {
            group_labels =[["撤销", "重做", "保存"],["日", "周", "月"],["加粗", "斜体", "下划线"]]
            type_labels =["折线", "面积", "柱状", "散点", "环形",
                "阶梯", "堆叠面积", "堆叠柱状", "水平条形", "饼图",
                "玫瑰", "雷达", "仪表盘", "气泡", "直方图",
                "箱线", "热力", "K 线", "瀑布", "漏斗",
                "样条线", "样条面积", "极坐标环", "树图", "桑基",
                "小提琴", "子弹图", "棒棒糖", "哑铃", "帕累托"]
        }
        for mode in 0:3 {for i in 0:3 {s.set_button_group_label(m.pages[38].ids[mode],(i + 1) * 10, group_labels[mode][i]) or >> }}
        for r in 0:6 {
            gid := m.pages[39].ids[1 + r]
            for k in 0:5 {
                key := r * 5 + k + 1
                s.set_button_group_label(gid, key, type_labels[key - 1]) or >>
            }
        }
        series := chart_data_locale(m.chart_kind, m.revision, english)
        s.set_chart_series(m.pages[39].ids[0], &series) or >>
        translated := workshop_menu_items(english)
        for page_index in 42:45 {for item in translated{s.set_menu_item_label(m.pages[page_index].ids[0], item.key, item.label) or >> }}
        $menu_labels :=["Actions", "Right click here", "Save"]
        if !english {menu_labels =["操作", "右键打开菜单", "保存"]}
        for page_index in 42:45 {s.set_menu_label(m.pages[page_index].ids[0], menu_labels[page_index - 42]) or >> }
        m.controls_dirty = true
    
        << 0
    }
    
    fn max_int_local(a int, b int) int {if a > b{ << a}
        << b}
    
    fn (m &Workshop) open_preferences(s $&widgets.Screen) int {
        pages := &m.pages
        page := &pages[33]
        s.set_value(page.ids[4], m.preferences_name) or >>
        s.set_toggle_value(page.ids[5], m.preferences_history) or >>
        s.set_field_invalid(page.ids[4], false) or >>
        s.open(page.ids[1]) or >>
        << 0
    }
    
    fn (m $&Workshop) pagination_invalid(s $&widgets.Screen) int {
        m.pagination_error = true
        page := m.page_snapshot(25)
        data := s.pagination_data(page.ids[0]) or >>
        s.set_field_invalid(page.ids[1], true) or >>
        $message := "Enter a page from 1 to " + str(data.pages) + "."
        if(s.selected(m.language) or >>) != 1 {message = "请输入 1 至 " + str(data.pages) + " 之间的页码。"}
        if data.pages == 0 {message = "No pages / 暂无数据,无法跳页。"}
        s.set_text(page.ids[5], message) or >>
        << 0
    }
    
    fn (m $&Workshop) update_pagination(s $&widgets.Screen, sync_input bool) int {
        page := m.page_snapshot(25)
        data := s.pagination_data(page.ids[0]) or >>
        s.set_text(page.ids[3], s.pagination_summary(page.ids[0]) or >>) or >>
        s.set_enabled(page.ids[1], data.pages > 0) or >>
        s.set_enabled(page.ids[4], data.pages > 0) or >>
        if sync_input{
            m.pagination_error = false
            s.set_field_invalid(page.ids[1], false) or >>
            $text := ""
            if data.current >= 0 {text = str(data.current + 1)}
            s.set_value(page.ids[1], text) or >> }
        if m.pagination_error{m.pagination_invalid(s) or >> }
        else {$hint := "Enter ↵ · 1–" + str(data.pages)
            if data.pages == 0 {hint = "No data / 暂无数据"}
            s.set_text(page.ids[5], hint) or >> }
        << 0
    }
    
    fn (m &Workshop) update_badges(s $&widgets.Screen) int {
        english := (s.selected(m.language) or >>) == 1
        pages := &m.pages
        page := &pages[30]
        s.set_badge_count(page.ids[0], m.unread, 99, false) or >>
        $summary := str(m.unread) + " 条未读 · 点击收件箱清零,徽标随数字收紧。"
        if english {summary = str(m.unread) + " unread · Click Inbox to clear; badge tightens with digits."}
        s.set_text(page.ids[6], summary) or >>
        s.set_visible(page.ids[3], m.online) or >>
        $name := "林文 · 离线"
        if m.online{name = "林文 · 在线"}
        if english {
            name = "Lin Wen · Away"
            if m.online{name = "Lin Wen · Available"}
        }
        s.set_text(page.ids[7], name) or >>
        << 0
    }
    
    fn (m $&Workshop) work(s $&widgets.Screen, now time.Instant) int {
        if !m.running || now.before(m.deadline) { << 0}
        for i in 0:5000 {m.checksum =(m.checksum + i *(m.completed + 1)) % 1000003}
        m.completed += 1
        id := m.pages[8].ids[0]
        _ := s.set_task_progress(id, m.revision, f64(m.completed) / 48.0) or >>
        m.deadline = now.add(time.milliseconds(35) or >>) or >>
        if m.failure && m.completed == 18 {_ := s.complete_task(id, m.revision, widgets.TASK_ERROR) or >>
            m.running = false
            m.failure = false
            if m.selected == 8 {s.set_selected_button(m.tools[1], false) or >> }}
        else if m.completed == 48 {_ := s.complete_task(id, m.revision, widgets.TASK_SUCCESS) or >>
            m.running = false}
        << 0
    }
    
    fn (m &Workshop) range_summary(s $&widgets.Screen, committed bool) int {
        english := (s.selected(m.language) or >>) == 1
        pages := &m.pages
        page := &pages[40]
        values := s.range_values(page.ids[0]) or >>
        $prefix := "预览"
        if committed{prefix = "已提交"}
        if english {
            prefix = "Preview"
            if committed{prefix = "Committed"}
        }
        text := strconv.format_float(values.lower, 102, 0) or >>
        upper := strconv.format_float(values.upper, 102, 0) or >>
        s.set_text(page.ids[1], prefix + " · " + text + " – " + upper) or >>
        << 0
    }
    
    fn (m $&Workshop) configure_controls(s $&widgets.Screen) int {
        position := m.selected
        page := m.page_snapshot(position)
        s.set_text(m.title, "XUUI  /  " + m.names[position]) or >>
        s.set_selected(m.navigation, position) or >>
        id := page.ids[0]
        state := s.selected(m.state) or >>
        s.set_enabled(id, state != 1) or >>
        if position == 45 {s.set_enabled(page.ids[1], state != 1) or >> }
        if position == 25 {s.set_enabled(page.group, state != 1) or >> }
        if read_only(m.selected) {s.set_read_only(id, state == 2) or >> }
        if invalid(m.selected) || m.selected == 31 || m.selected == 32 {s.set_invalid(id, state == 3) or >> }
        if position == 1 {for i in 0:9 {s.set_enabled(page.ids[i], state != 1) or >> }}
        if position == 38 {for i in 0:3 {
                s.set_button_group_item_enabled(page.ids[i], 20, !m.group_disabled) or >>
                s.set_enabled(page.ids[i], state != 1) or >>
                s.set_read_only(page.ids[i], state == 2) or >>
            }}
        if position == 39 {
            for r in 0:6 {
                gid := page.ids[1 + r]
                for k in 0:5 {
                    key := r * 5 + k + 1
                    s.set_button_group_checked(gid, key, m.chart_kind + 1 == key) or >>
                }
                s.set_enabled(gid, state != 1) or >>
                s.set_read_only(gid, state == 2) or >>
            }
        }
        english := (s.selected(m.language) or >>) == 1
        s.set_enabled(m.motion, animated(m.selected) ||(m.selected >= 33 && m.selected <= 36)) or >>
        s.set_selected_button(m.custom, m.customized) or >>
        $custom_text := "默认样式"
        if m.customized{custom_text = "自定义样式"}
        if english {
            custom_text = "Default"
            if m.customized{custom_text = "Custom"}
        }
        s.set_text(m.custom, custom_text) or >>
        $motion_text := "动效 160ms"
        if m.slow{motion_text = "动效 420ms"}
        if english {
            motion_text = "Motion 160ms"
            if m.slow{motion_text = "Motion 420ms"}
        }
        s.set_text(m.motion, motion_text) or >>
        caption := description_locale(m.selected, english)
        s.set_text(m.caption, caption) or >>
        $state_text := "悬停 · 按下 · Tab · 方向键 · Escape(使用真实鼠标与键盘状态)"
        if english {state_text = "Hover · press · Tab · arrows · Escape"}
        if(state == 2 && !read_only(m.selected)) ||(state == 3 && !invalid(m.selected) && m.selected != 31 && m.selected != 32) {
            state_text = "此组件没有该状态。预览保持其实际语义。"
            if english {state_text = "This component does not have that state; preview keeps its actual semantics."}
        }
        s.set_text(m.status, state_text) or >>
        labels := tool_labels_locale(m.selected, english)
        for i in 0:3 {s.set_text(m.tools[i], labels[i]) or >>
            s.set_selected_button(m.tools[i], false) or >>
            s.set_enabled(m.tools[i], labels[i].len > 0) or >>
            s.set_visible(m.tools[i], labels[i].len > 0) or >> }
        if m.selected == 8 {s.set_selected_button(m.tools[1], m.failure) or >> }
        s.set_visible(m.focus, focusable_sample(m.selected)) or >>
        << 0
    }
    Xustyle.xu
    @main
    
    #ui/widgets
    #ui/chart
    #ui/draw
    #ui/layout
    #time
    
    fn read_only(index int) bool { << index >= 38 ||(index >= 1 && index <= 26 && index != 8 && index != 25 && index != 26)}
    
    fn invalid(index int) bool { << index >= 40 || index >= 1 && index <= 30 && index != 7 && index != 8 && index != 12 && index != 24 && index != 25 && index != 26 && index != 28}
    
    fn animated(index int) bool { <<(index >= 38 && index <= 44) || index == 1 || index == 2 || index == 5 || index == 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 25}
    
    fn appearance(styles &widgets.Styles, index int) widgets.ControlStyle{
        if index == 0 {$c := styles.input.clone()
            c.padding = layout.Insets{left: 0.0, top: 0.0, right: 0.0, bottom: 0.0}
            c.align_x = 0.0
            c.align_y = 0.0
            << c}
        if index == 7 { << styles.tree_style()}
        if index == 24 { << styles.table_style()}
        if index == 9 || index == 10 || index == 11 || index == 12 { << styles.checkbox.clone()}
        if index == 3 || index == 5 || index == 45 { << styles.input.clone()}
        if index == 4 || index == 6 { << styles.text_area.clone()}
        if index == 13 || index == 40 { << styles.slider_style()}
        if index == 41 { << styles.card_style()}
        if index == 14 { << styles.stepper_style()}
        if index == 15 { << styles.select_style()}
        if index == 21 || index == 22 { << styles.tabs_style()}
        if index == 23 { << styles.list_box_style()}
        if index == 27 { << styles.progress.clone()}
        if index == 29 { << styles.divider_style()}
        if index == 30 { << styles.badge_style()}
        if index == 31 { << styles.card_style()}
        if index == 32 { << styles.scroll.clone()}
        << styles.button.clone()
    }
    
    fn (m $&Workshop) apply_appearance(s $&widgets.Screen) int {
        theme := s.selected(m.theme) or >>
        density := s.selected(m.density) or >>
        scale := s.selected(m.scale) or >>
        preset :=[widgets.THEME_LIGHT, widgets.THEME_DARK, widgets.THEME_CONTRAST][theme]
        $styles := widgets.preset_styles(preset) or >>
        styles.density =[1.0, 0.85, 1.25][density]
        styles.text_scale =[1.0, 1.4, 2.0][scale]
        sheet := widgets.screen_appearance(&styles, s.toggle_value(m.reduced) or >>) or >>
        s.apply_appearance(&sheet) or >>
        position := m.selected
        pages := &m.pages
        page := &pages[position]
        id := page.ids[0]
        if m.selected == 30 {$avatar := styles.button_variant(widgets.BUTTON_SUBTLE) or >>
            avatar.radius = 999.0
            s.set_control_style(page.ids[2], &avatar) or >> }
        if m.selected <= 32 || m.selected >= 40 {
            s.clear_control_style(id) or >>
            if m.customized{$c := appearance(&styles, m.selected)
                c.radius = 14.0
                c.border_width = 1.5
                c.padding.left += 4.0
                c.padding.right += 4.0
                s.set_control_style(id, &c) or >> }
        }
        $spec := widgets.motion_spec()
        if m.slow{spec.change = time.milliseconds(420) or >>
            spec.hover = time.milliseconds(320) or >>
            spec.enter = time.milliseconds(360) or >>
            spec.exit = time.milliseconds(240) or >>
            spec.curve = widgets.EASE_OUT_QUINT}
        if animated(m.selected) {s.set_motion(id, &spec) or >> }
        if m.selected == 1 {
            handles :=[page.ids[0], page.ids[1], page.ids[2], page.ids[3]]
            placements :=[widgets.ICON_LEADING, widgets.ICON_TRAILING, widgets.ICON_ABOVE, widgets.ICON_BELOW]
            english := (s.selected(m.language) or >>) == 1
            for i in 0:4 {
                icon_size := s.number_value(page.ids[9 + i]) or >>
                $icon_prefix := "图标 · "
                if english {icon_prefix = "Icon · "}
                s.set_text(page.ids[13 + i], icon_prefix + str(int(icon_size)) + " px") or >>
                $c := styles.button_variant(widgets.BUTTON_OUTLINE) or >>
                if i == 0 {c = styles.button_variant(widgets.BUTTON_PRIMARY) or >> }
                c.icon_placement = placements[i]
                c.icon_size = icon_size * styles.text_scale
                if m.customized{c.radius = 14.0
                    c.border_width = 1.5}
                s.set_control_style(handles[i], &c) or >>
                s.set_motion(handles[i], &spec) or >>
            }
        }
        if m.selected == 33 || m.selected == 34 || m.selected == 36 {s.set_motion(page.ids[1], &spec) or >>
            $c := styles.overlay_style()
            if m.customized{c.radius = 18.0
                c.border_width = 2.0}
            s.set_control_style(page.ids[1], &c) or >> }
        if m.selected == 34 {
            $placement := widgets.overlay_placement()
            placement.side = m.tooltip_side
            placement.align = widgets.OVERLAY_CENTER
            s.set_tooltip_placement(page.ids[1], &placement) or >>
        }
        if m.selected == 35 {
            s.set_notice_motion(&spec) or >>
            if m.customized{$c := styles.overlay_style()
                c.radius = 18.0
                c.border_width = 2.0
                s.set_notice_style(&c) or >> }
            else {s.clear_notice_style() or >> }
        }
        if m.selected == 38 {
            $group_appearance := widgets.button_group_appearance()
            group_appearance.vertical = m.group_vertical
            group_appearance.joined = m.group_joined
            for i in 0:3 {s.set_button_group_appearance(page.ids[i], &group_appearance) or >>
                s.clear_control_style(page.ids[i]) or >>
                s.set_motion(page.ids[i], &spec) or >>
                if m.customized{$c := styles.button_variant(widgets.BUTTON_OUTLINE) or >>
                    c.radius = 12.0
                    c.border_width = 1.5
                    s.set_control_style(page.ids[i], &c) or >> }}
        }
        if m.selected == 39 {
            s.clear_control_style(id) or >>
            $appearance := chart.chart_appearance()
            appearance.y_unit = " ms"
            if m.chart_kind == widgets.CHART_DONUT || m.chart_kind == widgets.CHART_PIE || m.chart_kind == widgets.CHART_ROSE ||
               m.chart_kind == widgets.CHART_FUNNEL || m.chart_kind == widgets.CHART_TREEMAP || m.chart_kind == widgets.CHART_SANKEY{appearance.y_unit = ""}
            else if m.chart_kind == widgets.CHART_GAUGE || m.chart_kind == widgets.CHART_POLAR_BAR{appearance.y_unit = "%"}
            if m.customized{appearance.grid = false
                appearance.area_opacity = 0.26
                appearance.inner_radius = 0.78
                appearance.palette =[draw.rgb(41, 126, 178), draw.rgb(215, 146, 42), draw.rgb(56, 153, 124)]
                $c := styles.card_style()
                c.radius = 18.0
                s.set_control_style(id, &c) or >> }
            s.set_chart_appearance(id, &appearance) or >>
            $options := widgets.animation_options()
            options.duration = time.milliseconds(650) or >>
            options.curve = widgets.EASE_IN_OUT_CUBIC
            if m.slow{options.duration = time.milliseconds(1200) or >> }
            s.set_chart_animation(id, &options) or >>
            if m.chart_paused{s.pause_chart_animation(id) or >> }
        }
        if m.selected == 40 {
            $options := widgets.range_slider_options()
            options.step = 5.0
            options.min_distance = 10.0
            if m.range_push{options.collision = widgets.RANGE_PUSH}
            options.vertical = m.range_vertical
            options.commit_only = m.range_commit
            s.set_range_options(id, &options) or >>
            $appearance := widgets.slider_appearance()
            appearance.ticks = 11
            appearance.show_value = true
            s.set_range_appearance(id, &appearance) or >>
        }
        if m.selected == 41 {
            $options := widgets.split_view_options()
            options.vertical = m.split_vertical
            options.minimum_first = 120.0 * styles.text_scale
            options.minimum_second = 140.0 * styles.text_scale
            s.set_split_options(id, &options) or >>
        }
        if m.selected >= 42 && m.selected <= 44 {
            $appearance := widgets.menu_appearance()
            appearance.close_on_select = !m.menu_stays_open
            s.set_menu_appearance(id, &appearance) or >>
        }
        if m.selected == 37 {$radius := 8.0
            if m.customized{radius = 18.0}
            s.set_webview_radius(id, radius) or >> }
        << 0
    }
    
    // Business handlers set option flags. Appearance changes run only here.
    fn (m $&Workshop) apply_page_options(s $&widgets.Screen) int {
        if m.tree_options_dirty{
            $appearance := widgets.tree_appearance()
            appearance.guides = m.guided
            s.set_tree_appearance(m.pages[7].ids[0], &appearance) or >>
            m.tree_options_dirty = false
        }
        if m.field_options_dirty{
            $decoration := widgets.field_decoration(&"Project name 项目名称")
            decoration.variant =(m.variant - 1) % 3
            decoration.floating =(m.variant - 1) % 4
            decoration.helper = "Floating / fixed label and stable helper area"
            decoration.error = "Please enter a valid name."
            decoration.clearable = true
            s.set_field_decoration(m.pages[m.field_options_page].ids[0], &decoration) or >>
            m.field_options_dirty = false
        }
        if m.spinner_options_dirty{
            s.set_spinner_appearance(m.pages[28].ids[0], 48.0, 4.0, time.milliseconds(1200) or >>) or >>
            m.spinner_options_dirty = false
        }
        if m.popover_options_dirty{
            $placement := widgets.overlay_placement()
            placement.side = m.variant
            placement.align = widgets.OVERLAY_CENTER
            s.set_popover_placement(m.pages[33].ids[1], &placement) or >>
            m.popover_options_dirty = false
        }
        << 0
    }
    Xuview.xu
    @main
    
    #ui
    #ui/widgets
    #ui/chart
    #ui/draw
    #time
    #math
    
    fn names()[]string { << names_locale(true) }
    
    fn names_locale(english bool)[]string {
        if english {
            <<["StyledLabel", "Button", "IconButton", "Input", "TextArea", "Field", "FieldArea", "TreeView", "TaskButton", "Checkbox", "Switch", "Radio", "RadioGroup", "Slider", "Stepper", "Select", "ComboBox", "MultiSelect", "DatePicker", "TimePicker", "ColorPicker", "Tabs", "Segmented", "ListBox", "Table", "Pagination", "Breadcrumbs", "Progress", "Spinner", "Divider", "Badge", "Card", "Scroll", "Popover", "Tooltip", "ToastHost", "Modal", "WebView", "ButtonGroup", "Chart", "RangeSlider", "SplitView", "Menu", "ContextMenu", "SplitButton", "PasswordInput"]
        }
        <<["StyledLabel 文本", "Button 按钮", "IconButton 图标按钮", "Input 单行输入", "TextArea 多行输入", "Field 表单字段", "FieldArea 多行字段", "TreeView 树形视图", "TaskButton 任务按钮", "Checkbox 复选框", "Switch 开关", "Radio 单选框", "RadioGroup 单选组", "Slider 滑块", "Stepper 步进器", "Select 下拉选择", "ComboBox 组合框", "MultiSelect 多选框", "DatePicker 日期选择", "TimePicker 时间选择", "ColorPicker 颜色选择", "Tabs 标签页", "Segmented 分段控件", "ListBox 列表框", "Table 数据表格", "Pagination 分页器", "Breadcrumbs 面包屑", "Progress 进度条", "Spinner 加载指示", "Divider 分割线", "Badge 徽标", "Card 卡片", "Scroll 滚动容器", "Popover 气泡浮层", "Tooltip 文字提示", "ToastHost 通知队列", "Modal 模态弹窗", "WebView 网页视图", "ButtonGroup 按钮组", "Chart 图表", "RangeSlider 区间滑块", "SplitView 分栏视图", "Menu 下拉菜单", "ContextMenu 右键菜单", "SplitButton 拆分按钮", "PasswordInput 密码框"]
    }
    
    fn new_page(s $&widgets.Screen, index int) Page{
        group := s.group() or >>
        $ids :=[]int {}
        choices :=["Workspace 工作区", "History 历史", "Output 输出"]
        if index == 0 {ids.push(s.label("清晰的层级,让每个细节都服务于使用。\n中文、English 与 emoji 👩🏽‍💻 都使用原生排版。", 20.0, false) or >>)
            s.set_label_wrapped(ids[0], true) or >>
            ids.push(s.label("很长的完整内容:Cluster-safe truncation · 👨‍👩‍👧‍👦 family · workspace / widgets / component.xu", 16.0, false) or >>)
            s.set_label_ellipsis(ids[1], true) or >>
            anchor := ids[1]
            ids.push(s.tooltip(anchor, "很长的完整内容:Cluster-safe truncation · 👨‍👩‍👧‍👦 family · workspace / widgets / component.xu") or >>)}
        if index == 1 {
            $sizes :=[]int {}
            $labels :=[]int {}
            for text in["Build project", "Open workspace · trailing", "Save changes · above", "Download SDK · below"] {
                // Each inspector precedes its own button in both layout and Tab order.
                inspector := s.stepper(12.0, 64.0, 4.0, 24.0) or >>
                sizes.push(inspector)
                _ := s.tooltip(inspector, text + " · Icon size 图标尺寸 (px)") or >>
                labels.push(s.label("Icon 图标 · 24 px", 14.0, true) or >>)
                ids.push(s.button_with_icon("logo.png", text) or >>)}
            for text in["Secondary", "Outline", "Ghost", "Danger", "Subtle"] {ids.push(s.button(text) or >>)}
            s.set_button_variant(ids[0], widgets.BUTTON_PRIMARY) or >>
            for variant in 1:6 {s.set_button_variant(ids[variant + 3], variant) or >> }
            for id in sizes{ids.push(id)}
            for id in labels{ids.push(id)}}
        if index == 2 {ids.push(s.icon_button("logo.png", "Open XU workspace") or >>)
            anchor := ids[0]
            ids.push(s.tooltip(anchor, "Open XU workspace · Enter") or >>)}
        if index == 3 {ids.push(s.input("中文 / English / 🙂") or >>)}
        if index == 4 {ids.push(s.text_area("Native text editing\n选择文字、复制、粘贴,保留输入法会话。\n👩🏽‍💻 family 👨‍👩‍👧‍👦") or >>)}
        if index == 5 || index == 6 {
            $decoration := widgets.field_decoration(&"Project name 项目名称")
            decoration.helper = "Enter a name · Native IME / selection / clipboard"
            decoration.error = "名称不能为空。Please enter a project name."
            decoration.clearable = true
            if index == 5 {decoration.prefix = "xu /"
                ids.push(s.field("", &decoration) or >>)}
            else {ids.push(s.text_field_area("Build notes\n中文与 emoji 🙂", &decoration) or >>)}
            $options := widgets.field_text_options()
            options.counter = true
            options.character_limit = 32
            if index == 6 {options.min_rows = 3
                options.max_rows = 6}
            s.set_field_text_options(ids[0], &options) or >>
        }
        if index == 7 {
            ids.push(s.tree() or >>)
            root := s.tree_add(ids[0], - 1, "XU workspace") or >>
            src := s.tree_add(ids[0], root, "src") or >>
            widgets_node := s.tree_add(ids[0], src, "widgets") or >>
            for name in["tree_view.xu", "task_button.xu", "field.xu", "screen.xu"] {leaf := s.tree_add(ids[0], widgets_node, name) or >>
                s.set_tree_metadata(ids[0], leaf, "Xu") or >>
                s.set_tree_action(ids[0], leaf, true) or >> }
            _ := s.tree_add(ids[0], root, "xu.xun") or >>
            for node in[root, src, widgets_node] {s.set_expanded(ids[0], node, true) or >> }
            $appearance := widgets.tree_appearance()
            appearance.guides = true
            s.set_tree_appearance(ids[0], &appearance) or >>
            $decoration := widgets.field_decoration(&"Find a node")
            decoration.clearable = true
            ids.push(s.field("", &decoration) or >>)
        }
        if index == 8 {ids.push(s.task_button("Build project") or >>)
            s.set_task_labels(ids[0], "Building", "Built · run again", "Retry build", "Build again") or >> }
        if index == 9 {ids.push(s.checkbox("Keep generated files 保留产物", true) or >>)}
        if index == 10 {ids.push(s.switch_control("Live preview 实时预览", true) or >>)}
        if index == 11 {ids.push(s.radio("Use workspace settings", 1, true) or >>)}
        if index == 12 {ids.push(s.radio_group(&choices, 0) or >>)}
        if index == 13 {ids.push(s.slider(0.0, 100.0, 40.0) or >>)
            $appearance := widgets.slider_appearance()
            appearance.ticks = 11
            appearance.show_value = true
            s.set_slider_appearance(ids[0], &appearance, 10.0) or >>
            s.set_slider_commit_only(ids[0], true) or >>
            $decoration := widgets.field_decoration(&"Exact value / 精确数值")
            decoration.helper = "0–100 · step 10 · Apply input"
            decoration.error = "Enter a number between 0 and 100."
            ids.push(s.field("40", &decoration) or >>)}
        if index == 14 {ids.push(s.stepper(0.0, 100.0, 1.0, 24.0) or >>)
            s.set_stepper_repeat(ids[0], true, time.milliseconds(400) or >>, time.milliseconds(80) or >>) or >> }
        if index == 15 {$unavailable := widgets.select_option("Remote (unavailable)")
            unavailable.enabled = false
            options :=[widgets.select_group("LOCAL"), widgets.select_option("Workspace 工作区"), widgets.select_option("History 历史"), widgets.select_group("REMOTE"), unavailable]
            ids.push(s.select_options(&options, 1) or >>)}
        if index == 16 {ids.push(s.combo_box(&choices, "") or >>)
            s.set_combo_custom_values(ids[0], false) or >> }
        if index == 17 {ids.push(s.multi_select(&choices) or >>)
            $decoration := widgets.field_decoration(&"Filter options")
            decoration.clearable = true
            ids.push(s.field("", &decoration) or >>)}
        if index == 18 || index == 19 {value := time.date(2026, 10, 25, 14, 30, 0, 0)
            if index == 18 {ids.push(s.date_picker(value) or >>)
                s.set_date_options(ids[0], value, true) or >> }
            else {ids.push(s.time_picker(value) or >>)
                s.set_clock_format(ids[0], true, true) or >> }}
        if index == 20 {ids.push(s.color_picker(draw.rgb(180, 57, 45)) or >>)
            s.set_color_swatches(ids[0], &[draw.rgb(180, 57, 45), draw.rgb(50, 121, 160), draw.rgb(72, 130, 90)]) or >>
            $decoration := widgets.field_decoration(&"HEX / RGBA")
            decoration.helper = "#RGB, #RGBA, #RRGGBB, #RRGGBBAA"
            decoration.error = "Use a valid HEX value."
            ids.push(s.field("#B4392DFF", &decoration) or >>)}
        if index == 21 {ids.push(s.tabs(&choices, 0) or >>)
            s.set_tab_behavior(ids[0], &[180.0, 144.0, 160.0], false) or >> }
        if index == 22 {ids.push(s.segmented(&["Day", "Week", "Month"], 0) or >>)}
        if index == 23 {ids.push(s.list_box(&["TreeView", "TaskButton", "Field", "Table", "WebView", "Scroll", "Tabs", "Select", "ToastHost"], 0) or >>)
            for row in 0:9 {$detail := widgets.list_row(["TreeView", "TaskButton", "Field", "Table", "WebView", "Scroll", "Tabs", "Select", "ToastHost"][row])
                detail.description = "Native component · 原生交互"
                detail.detail = "Ready"
                detail.icon = widgets.TREE_ICON_FILE
                s.set_list_row(ids[0], row, &detail) or >> }}
        if index == 24 {ids.push(s.table(&["Component", "Build ms", "Status"], 12, 0) or >>)
            components :=["Button", "TreeView", "Field", "Input", "Tabs", "Checkbox", "Switch", "Menu", "WebView", "Chart", "Table", "Badge"]
            durations :=[14, 7, 120, 3, 21, 7, 45, 9, 210, 32, 18, 2]
            for row in 0:12 {s.set_cell(ids[0], row, 0, components[row]) or >>
                s.set_cell(ids[0], row, 1, str(durations[row])) or >>
                s.set_cell(ids[0], row, 2,["Ready", "Review", "Draft"][row % 3]) or >> }
            s.set_table_sort_kind(ids[0], 1, widgets.TABLE_SORT_NUMBER) or >>
            s.set_table_column_min_width(ids[0], 0, 160.0) or >>
            s.set_table_column(ids[0], 0, 280.0, 0.0) or >>
            s.set_table_column(ids[0], 1, 160.0, 1.0) or >>
            s.set_table_column(ids[0], 2, 200.0, 0.0) or >> }
        if index == 25 {ids.push(s.pagination(1000, 122) or >>)
            s.set_pagination_data(ids[0], 20000, 20) or >>
            $decoration := widgets.field_decoration(&"Page 页码")
            decoration.helper = ""
            decoration.error = ""
            decoration.reserve_helper = false
            decoration.floating = widgets.LABEL_ALWAYS
            ids.push(s.field("123", &decoration) or >>)
            ids.push(s.select_box(&["10 / page", "20 / page", "50 / page", "100 / page"], 1) or >>)
            ids.push(s.label("", 14.0, true) or >>)
            s.set_label_wrapped(ids[3], true) or >>
            ids.push(s.button("Go 跳转") or >>)
            ids.push(s.label("", 13.0, true) or >>)
            s.set_label_wrapped(ids[5], true) or >> }
        if index == 26 {ids.push(s.breadcrumbs(&["Home", "XU workspace", "src", "ui", "widgets", "A long Chinese path 中文路径", "field.xu"]) or >>)}
        if index == 27 {ids.push(s.progress(0.42) or >>)
            s.set_progress_buffer(ids[0], 0.72) or >> }
        if index == 28 {ids.push(s.spinner() or >>)
            s.set_spinner_appearance(ids[0], 32.0, 3.0, time.milliseconds(900) or >>) or >>
            s.set_running(ids[0], true) or >>
            ids.push(s.label("Loading assets… 正在加载", 14.0, true) or >>)}
        if index == 29 {ids.push(s.divider(widgets.AXIS_HORIZONTAL) or >>)
            ids.push(s.label("SECTION / 章节", 12.0, true) or >>)}
        if index == 30 {
            inbox := s.button("Inbox 收件箱") or >>
            count := s.badge_on(inbox, "12", widgets.BADGE_COUNT) or >>
            s.set_badge_tone(count, widgets.BADGE_ERROR) or >>
            avatar := s.button("LW") or >>
            s.set_button_variant(avatar, widgets.BUTTON_SUBTLE) or >>
            dot := s.badge_on(avatar, "", widgets.BADGE_DOT) or >>
            s.set_badge_anchor(dot, avatar, 0.86, 0.86) or >>
            s.set_badge_tone(dot, widgets.BADGE_SUCCESS) or >>
            synced := s.badge("Synced 已同步") or >>
            s.set_badge_tone(synced, widgets.BADGE_SUCCESS) or >>
            beta := s.badge("BETA") or >>
            s.set_badge_tone(beta, widgets.BADGE_INFO) or >>
            ids =[count, inbox, avatar, dot, synced, beta,
            s.label("12 unread · 点击收件箱清零,徽标随数字收紧。", 14.0, true) or >>,
            s.label("林文 · Available 在线", 16.0, false) or >>,
            s.label("点击头像切换在线状态;状态点不单独承担文字含义。", 13.0, true) or >>,
            s.label("Workspace 工作区", 16.0, false) or >>]
        }
        if index == 31 {
            ids.push(s.card() or >>)
            sections := s.card_sections(ids[0], 36.0, 44.0) or >>
            for parent in[sections.header, sections.body, sections.footer] {ids.push(parent)}
            ids.push(s.label("Workspace configuration", 18.0, false) or >>)
            ids.push(s.label("Header, body and footer keep distinct spacing.\n正文区域随密度与字号调整。", 14.0, true) or >>)
            s.set_label_wrapped(ids[5], true) or >>
            ids.push(s.button("Open workspace") or >>)
            s.set_parent(ids[4], sections.header) or >>
            s.set_parent(ids[5], sections.body) or >>
            s.set_parent(ids[6], sections.footer) or >>
        }
        if index == 32 {ids.push(s.scroll_area(widgets.AXIS_VERTICAL, 1100.0) or >>)
            for row in 0:14 {id := s.button("Focusable row " + str(row + 1) + " · 滚动内容") or >>
                s.set_parent(id, ids[0]) or >>
                ids.push(id)}}
        if index >= 33 && index <= 36 {ids.push(s.button(["Open popover", "Focus or hover for help", "Enqueue notification", "Open confirmation"][index - 33]) or >>)
            anchor := ids[0]
            if index == 33 {
                ids.push(s.popover(anchor, "") or >>)
                ids.push(s.label("Workspace preferences", 18.0, false) or >>)
                ids.push(s.label("Edit a draft, then apply. Escape or clicking outside dismisses.\n编辑草稿后应用;关闭不会提交。", 13.0, true) or >>)
                s.set_label_wrapped(ids[3], true) or >>
                $decoration := widgets.field_decoration(&"Workspace name 工作区名称")
                decoration.clearable = true
                decoration.error = "名称不能为空 / Enter a name"
                ids.push(s.field("XU workspace", &decoration) or >>)
                ids.push(s.checkbox("Keep history 保留历史", true) or >>)
                ids.push(s.button("Cancel 取消") or >>)
                ids.push(s.button("Apply 应用") or >>)
                s.set_button_variant(ids[7], widgets.BUTTON_PRIMARY) or >>
                ids.push(s.label("Current: XU workspace · history on", 14.0, true) or >>)
                for i in 2:8 {s.set_parent(ids[i], ids[1]) or >> }
            }
            if index == 34 {ids.push(s.tooltip(anchor, "Hover waits 500 ms; keyboard focus shows help immediately.\n鼠标离开或点击收起;Escape 抑制重复提示。") or >>)}
            if index == 36 {ids.push(s.modal("Apply configuration?", "Focus stays inside this confirmation. Escape returns to the trigger.") or >>)
                ids.push(s.button("Cancel") or >>)
                ids.push(s.button("Apply changes") or >>)
                s.set_parent(ids[2], ids[1]) or >>
                s.set_parent(ids[3], ids[1]) or >> }
        }
        if index == 37 {ids.push(s.webview() or >>)
            s.load_web_html(ids[0], "<!doctype html><html><meta charset='utf-8'><style>body{font:16px system-ui;background:#f3f2ee;color:#292c30;padding:24px}input{font:inherit;padding:12px;border:1px solid #747b83;border-radius:6px;width:80%}h2{font-weight:500}</style><h2>WebView is a component.</h2><p>Native focus, clipping and independent lifecycle.</p><input aria-label='Web content' placeholder='中文 / English / 🙂'></html>") or >> }
        if index == 38 {
            actions :=[widgets.button_group_item(10, "Undo"), widgets.button_group_item(20, "Redo"), widgets.button_group_item(30, "Save")]
            group_choices :=[widgets.button_group_item(10, "Day"), widgets.button_group_item(20, "Week"), widgets.button_group_item(30, "Month")]
            formats :=[widgets.button_group_item(10, "Bold"), widgets.button_group_item(20, "Italic"), widgets.button_group_item(30, "Underline")]
            ids.push(s.button_group(&actions, widgets.BUTTON_GROUP_ACTIONS) or >>)
            ids.push(s.button_group(&group_choices, widgets.BUTTON_GROUP_SINGLE) or >>)
            ids.push(s.button_group(&formats, widgets.BUTTON_GROUP_MULTIPLE) or >>)
            ids.push(s.label("Actions / 独立操作", 12.0, true) or >>)
            ids.push(s.label("Single / 单选", 12.0, true) or >>)
            ids.push(s.label("Multiple / 多选", 12.0, true) or >>)
        }
        if index == 39 {
            ids.push(s.chart() or >>)
            row0 :=[widgets.button_group_item(1, "Line"), widgets.button_group_item(2, "Area"), widgets.button_group_item(3, "Bar"), widgets.button_group_item(4, "Scatter"), widgets.button_group_item(5, "Donut")]
            row1 :=[widgets.button_group_item(6, "Step"), widgets.button_group_item(7, "StackArea"), widgets.button_group_item(8, "StackBar"), widgets.button_group_item(9, "H-Bar"), widgets.button_group_item(10, "Pie")]
            row2 :=[widgets.button_group_item(11, "Rose"), widgets.button_group_item(12, "Radar"), widgets.button_group_item(13, "Gauge"), widgets.button_group_item(14, "Bubble"), widgets.button_group_item(15, "Histogram")]
            row3 :=[widgets.button_group_item(16, "Boxplot"), widgets.button_group_item(17, "Heatmap"), widgets.button_group_item(18, "Candle"), widgets.button_group_item(19, "Waterfall"), widgets.button_group_item(20, "Funnel")]
            row4 :=[widgets.button_group_item(21, "Spline"), widgets.button_group_item(22, "SplineArea"), widgets.button_group_item(23, "PolarBar"), widgets.button_group_item(24, "Treemap"), widgets.button_group_item(25, "Sankey")]
            row5 :=[widgets.button_group_item(26, "Violin"), widgets.button_group_item(27, "Bullet"), widgets.button_group_item(28, "Lollipop"), widgets.button_group_item(29, "Dumbbell"), widgets.button_group_item(30, "Pareto")]
            $selector := widgets.button_group_appearance()
            selector.equal_width = true
            selector.allow_empty = true
            rows :=[row0, row1, row2, row3, row4, row5]
            for r in 0:6 {
                gid := s.button_group(&rows[r], widgets.BUTTON_GROUP_SINGLE) or >>
                s.set_button_group_appearance(gid, &selector) or >>
                ids.push(gid)
            }
            series := chart_data(widgets.CHART_LINE, 0)
            s.set_chart_series(ids[0], &series) or >>
        }
        if index == 40 {
            ids.push(s.range_slider(0.0, 100.0, 20.0, 80.0) or >>)
            ids.push(s.label("20 – 80", 18.0, false) or >>)
            ids.push(s.label("Drag either thumb or the selected band. Tab visits both thumbs. Escape cancels a pending edit.\n拖动端点或整段;Tab 访问两个端点。", 14.0, true) or >>)
            s.set_label_wrapped(ids[2], true) or >>
        }
        if index == 41 {
            ids.push(s.split_view(0.4) or >>)
            split := ids[0]
            ids.push(s.split_pane(split, 0) or >>)
            ids.push(s.split_pane(split, 1) or >>)
            ids.push(s.label("Workspace / 工作区\nPane content follows the available size.", 16.0, false) or >>)
            ids.push(s.label("Preview / 预览\nDrag the handle; arrows adjust, Shift accelerates.", 16.0, false) or >>)
            ids.push(s.button("Open workspace") or >>)
            ids.push(s.button("Refresh preview") or >>)
            for i in 0:2 {s.set_label_wrapped(ids[3 + i], true) or >>
                s.set_parent(ids[3 + i], ids[1 + i]) or >>
                s.set_parent(ids[5 + i], ids[1 + i]) or >> }
        }
        if index >= 42 && index <= 44 {
            mode :=[widgets.MENU_DROPDOWN, widgets.MENU_CONTEXT, widgets.MENU_SPLIT][index - 42]
            label :=["Actions", "Right click here · 右键打开菜单", "Save"][index - 42]
            ids.push(s.menu(label, &workshop_menu_items(true), mode, 100) or >>)
            ids.push(s.label("Choose an action · 选择操作", 16.0, false) or >>)
            ids.push(s.label("Check and radio items preserve their state. Navigate submenus with arrows; Escape returns one level.\n操作文案与快捷键由应用配置。", 14.0, true) or >>)
            s.set_label_wrapped(ids[1], true) or >>
            s.set_label_wrapped(ids[2], true) or >>
        }
        if index == 45 {
            ids.push(s.password_input("Xu-密码🙂") or >>)
            ids.push(s.checkbox("Show password 显示密码", false) or >>)
            ids.push(s.label("Password 密码", 15.0, false) or >>)
            ids.push(s.label("Paste is supported. Copy and cut are blocked even when revealed.\n支持粘贴、选择和中英文输入;显隐切换保留内容与光标。", 14.0, true) or >>)
            s.set_label_wrapped(ids[3], true) or >>
        }
        for i in 0:ids.len{
            // Card slots and scroll children retain their content parent.
            if index == 30 &&(i == 0 || i == 3) { -> }
            if index == 31 && i > 0 { -> }
            if index == 41 && i > 0 { -> }
            if index == 32 && i > 0 { -> }
            if index == 36 && i > 1 { -> }
            if index == 33 && i >= 2 && i <= 7 { -> }
            s.set_parent(ids[i], group) or >>
        }
        s.set_visible(group, false) or >>
        << Page{group: group, ids: ids}
    }
    
    fn description(index int) string { << description_locale(index, false) }
    
    fn description_locale(index int, english bool) string {
        if english {
            if index == 45 { << "Unicode grapheme masking; reveal toggle, native editing, read-only and disabled states; copy/cut blocked."}
            if index == 40 { << "Dual-thumb range: step, minimum distance, clamp/push, band dragging; independent focus and commit."}
            if index == 41 { << "Resizable split panes: minimum constraints, collapse/restore, keyboard adjustment; content clipped per pane."}
            if index >= 42 && index <= 44 { << "Action / check / radio / submenu items; keyboard navigation, edge flipping, shortcuts and per-item feedback."}
            if index == 38 { << "Actions / single / multiple selection; per-item disable, arrow navigation, Enter or Space activation."}
            if index == 39 { << "Native interactive charts (30 types): stable-ID transitions, hover/select, legend; Ctrl/⌘ + wheel zoom, drag pan, double-click reset."}
            en :=["Layered body, heading and muted text; native line wrapping and font overrides.",
            "Leading / trailing / above / below icons; independent size steppers and content-width wrapping.",
            "Standalone hit target and action label; keyboard focus also triggers tooltip help.",
            "Native single-line editing: selection, copy, paste and IME composition.",
            "Native multi-line editing: paragraphs, internal scrolling and IME candidate placement.",
            "Floating / fixed labels and three border variants; soft counter never truncates input.",
            "Multi-line Field: min 3 rows, max 6 rows; character counter and stable helper region.",
            "Hierarchy guides, vector arrows, icons, metadata, filtering and node actions.",
            "Real compute batches drive progress; task ID rejects stale callbacks.",
            "Full-row click target; indeterminate mixed state; interruptible check animation.",
            "Track and thumb transition; interruptible rapid toggling; read-only preserves focus.",
            "Single radio item and selection animation; full label hit target.",
            "Arrow keys manage mutual exclusion; Tab enters the group once.",
            "11 ticks, step-10 snapping, value readout; commit on release.",
            "Hold to repeat and accelerate; stops cleanly at bounds.",
            "Typed groups and disabled options; arrow keys skip non-selectable rows.",
            "Local match highlighting and empty state; configurable free-text input.",
            "Candidate filtering, removable tags, select-all and clear actions.",
            "Today / Clear actions; Page Up/Down switches months, Shift switches years.",
            "12/24-hour clock format; stores explicit typed time values.",
            "RGBA channels, exact HEX input, swatches and recent color history.",
            "Variable-width tabs; arrow keys move focus, Enter activates manually.",
            "Segmented selection plate and container semantics distinct from Tabs.",
            "Icon / primary & secondary text / trailing detail; hit testing scales with font size.",
            "Resizable columns, horizontal & vertical scrolling, and data status messages.",
            "First, last and ellipsis items; fast page jumping for large datasets.",
            "Preserves current path; middle segments collapse into an interactive menu.",
            "Determinate progress and buffer shown separately without fabricated percentages.",
            "Configurable size, stroke width and period; static feedback under reduced motion.",
            "Subtle divider paired with section heading; unified horizontal and vertical spec.",
            "Badges in context: unread count, avatar status dot and status tags.",
            "Header / body / footer content slots; actions use standalone Buttons.",
            "True child clipping, wheel bubbling, track dragging and keyboard focus scroll-into-view.",
            "Anchor placement and edge flipping; outside click or Escape dismisses.",
            "Hover delay and immediate focus help; Escape suppresses repeated tooltips.",
            "Up to three visible notices; queueing, deduplication, priority and undo action.",
            "Modal focus loop and restoration; safe action receives initial focus.",
            "Native webview child component with clipping and independent lifecycle."]
            << en[index]
        }
        if index == 45 { << "按 Unicode 字素掩码;显隐切换、原生编辑、只读与禁用,禁止复制或剪切密码。"}
        if index == 40 { << "双端区间:步进、最小间距、端点推挤、整段拖动;独立焦点与提交。"}
        if index == 41 { << "可调整分栏:尺寸约束、折叠恢复、键盘调整;内容保持在各自面板内。"}
        if index >= 42 && index <= 44 { << "动作 / 勾选 / 单选 / 子菜单;键盘、边缘翻转、快捷键与可定制的逐项反馈。"}
        if index == 38 { << "独立操作 / 单选 / 多选;逐项禁用,方向键导航,Enter 或空格激活。"}
        if index == 39 { << "原生交互图表(30 种类型):稳定 ID 数据过渡、悬停/选中、图例;Ctrl/⌘ + 滚轮缩放,拖动平移,双击复位。"}
        descriptions :=["正文、标题与辅助文字分层;原生换行与字体覆盖。",
        "图标左 / 右 / 上 / 下;各自调节尺寸,按钮按内容宽度自动换行。",
        "独立点击目标与动作名称;键盘焦点也能查看提示。",
        "原生单行编辑:选区、复制、粘贴与 IME。",
        "原生多行编辑:段落、内部滚动与输入法候选定位。",
        "浮动标签 / 固定标签 / 三种边框;软计数不截断输入。",
        "多行 Field:最小 3 行、最大 6 行;计数与稳定辅助区。",
        "层级引导、矢量箭头、图标、元数据、筛选和节点动作。",
        "真实计算批次驱动进度;任务 ID 拒绝旧回调。",
        "整行点击;混合态;可中断的勾选显现。",
        "轨道与圆钮过渡;快速切换可中断;只读保留焦点。",
        "单项选择与选中动效;完整标签点击目标。",
        "方向键管理互斥;Tab 只进入一次。",
        "11 个刻度、10 步吸附、数值提示;松开才提交。",
        "按住连续增加并加速;到达边界停止。",
        "有类型的分组 / 禁用选项;方向键跳过不可选行。",
        "本地匹配高亮与无结果;可控制是否接受自由输入。",
        "候选筛选、可移除标签、全选和清空。",
        "今天 / 清空;Page Up/Down 快速翻月,Shift 切年。",
        "12/24 小时可选;存储保持明确的时间值。",
        "RGBA 通道、HEX 精确输入、色板与最近颜色。",
        "可变宽标签;方向键移动,Enter 手动激活。",
        "与 Tabs 分开的选中底板和容器语义。",
        "图标 / 主副文本 / 尾部信息;字体放大后命中保持一致。",
        "拖动调整列宽;横向与纵向滚动;数据状态文字。",
        "首页、末页与省略项;大页数仍可快速定位。",
        "保留当前路径;中间段收进可交互的菜单。",
        "真实确定进度与缓冲区分别显示,不伪造百分比。",
        "大小 / 粗细 / 周期可配置;减少动效显示静态反馈。",
        "弱分隔与章节文字组合;水平和垂直使用同一规范。",
        "Badge 放入真实上下文:未读计数、头像状态点与列表标签。",
        "Header / body / footer 内容槽;动作使用独立 Button。",
        "真实子控件裁剪、滚轮冒泡、轨道拖动与键盘焦点滚入。",
        "锚点定位、边缘翻转;外点 / Escape 关闭。",
        "Hover 延迟、focus 立即显示;Escape 抑制重复提示。",
        "最多三条可见通知;队列、去重、优先级与撤销动作。",
        "模态焦点循环与恢复;安全动作先获得焦点。",
        "原生网页子视图作为 Screen 组件,支持裁剪与独立生命周期。"]
        << descriptions[index]
    }
    
    fn tool_labels(index int)[]string { << tool_labels_locale(index, false) }
    
    fn tool_labels_locale(index int, english bool)[]string {
        if english {
            if index == 45 { <<["Clear", "Reset sample", "Focus input"]}
            if index == 40 { <<["Clamp / push", "Commit mode", "Orientation"]}
            if index == 41 { <<["Orientation", "Collapse / restore", "Reset ratio"]}
            if index >= 42 && index <= 44 { <<["Open menu", "Keep open", "Disable export"]}
            if index == 38 { <<["Disable middle", "Orientation", "Joined / gap"]}
            if index == 39 { <<["Update data", "Reset zoom", "Pause / resume"]}
            if index == 0 { <<["Long text", "Short text", ""]}
            if index == 1 || index == 2 { <<["Select", "Clear selection", ""]}
            if index == 3 || index == 4 { <<["Clear", "Long text", ""]}
            if index == 5 || index == 6 { <<["Clear", "Long text", "Appearance"]}
            if index == 7 { <<["Guides", "Reveal last", "Clear filter"]}
            if index == 8 { <<["Progress mode", "Fail next", "Cancel"]}
            if index == 9 { <<["Mixed", "Checked", "Unchecked"]}
            if index == 10 { <<["Pending", "Resolve", "Fail"]}
            if index == 11 { <<["Select", "Deselect", ""]}
            if index == 13 { <<["Apply input", "Commit only", "Live updates"]}
            if index == 15 { <<["Open", "Disable option", ""]}
            if index == 16 { <<["Allow custom", "Options only", "Clear"]}
            if index == 17 { <<["Select all", "Clear", ""]}
            if index == 18 { <<["Clear", "Set today", ""]}
            if index == 19 { <<["12 hour", "24 hour", "Hide seconds"]}
            if index == 20 { <<["Apply HEX", "Cinnabar", "Transparent"]}
            if index == 24 { <<["Data", "Loading", "Error"]}
            if index == 25 { <<["Jump", "Last page", "Empty / full"]}
            if index == 27 { <<["0%", "42%", "100%"]}
            if index == 28 { <<["Start", "Stop", "Large size"]}
            if index == 30 { <<["+1 unread", "Clear", "99+ overflow"]}
            if index == 32 { <<["Scroll top", "Scroll bottom", "Focus last"]}
            if index == 33 { <<["Open", "Close", "Placement"]}
            if index == 34 { <<["Focus help", "Blur", "Placement"]}
            if index == 35 { <<["Enqueue", "Undo", "Burst 3"]}
            if index == 36 { <<["Open", "Close", ""]}
            if index == 37 { <<["Reload", "Hide", "Show"]}
            <<["", "", ""]
        }
        if index == 45 { <<["清空", "重置示例", "聚焦输入"]}
        if index == 40 { <<["端点限制 / 推挤", "提交模式", "切换方向"]}
        if index == 41 { <<["切换方向", "折叠 / 恢复", "复位比例"]}
        if index >= 42 && index <= 44 { <<["打开菜单", "保持展开", "禁用导出"]}
        if index == 38 { <<["逐项禁用", "切换方向", "拼接 / 间距"]}
        if index == 39 { <<["更新数据", "复位缩放", "暂停 / 继续"]}
        if index == 0 { <<["切换长文", "切换短文", ""]}
        if index == 1 || index == 2 { <<["设为选中", "取消选中", ""]}
        if index == 3 || index == 4 { <<["清空内容", "填充长文", ""]}
        if index == 5 || index == 6 { <<["清空内容", "填充长文", "切换外观"]}
        if index == 7 { <<["引导线", "定位末项", "清空筛选"]}
        if index == 8 { <<["进度外观", "下次失败", "取消任务"]}
        if index == 9 { <<["混合态", "勾选", "取消勾选"]}
        if index == 10 { <<["等待态", "完成切换", "失败恢复"]}
        if index == 11 { <<["选中", "取消选中", ""]}
        if index == 13 { <<["应用输入", "松开提交", "实时更新"]}
        if index == 15 { <<["展开候选", "禁用选项", ""]}
        if index == 16 { <<["允许自由输入", "仅限选项", "清空"]}
        if index == 17 { <<["全选", "清空", ""]}
        if index == 18 { <<["清空日期", "设为今天", ""]}
        if index == 19 { <<["12 小时制", "24 小时制", "隐藏秒数"]}
        if index == 20 { <<["应用 HEX", "朱砂色", "半透明"]}
        if index == 24 { <<["正常数据", "正在加载", "加载错误"]}
        if index == 25 { <<["页码跳转", "跳至末页", "空 / 满数据"]}
        if index == 27 { <<["0%", "42%", "100%"]}
        if index == 28 { <<["开始旋转", "停止旋转", "切换大号"]}
        if index == 30 { <<["+1 未读", "清零未读", "99+ 溢出"]}
        if index == 32 { <<["滚至顶部", "滚至底部", "聚焦末项"]}
        if index == 33 { <<["打开浮层", "关闭浮层", "切换方位"]}
        if index == 34 { <<["聚焦提示", "移出隐藏", "切换方位"]}
        if index == 35 { <<["发送通知", "撤销通知", "连发三条"]}
        if index == 36 { <<["打开确认框", "关闭确认框", ""]}
        if index == 37 { <<["重新加载", "隐藏视图", "恢复显示"]}
        <<["", "", ""]
    }
    
    fn workshop_menu_items(english bool)[]widgets.MenuItem{
        labels :=["Open workspace", "Show grid", "Export", "PNG image", "SVG image", "Unavailable", "Save", "View density", "Compact", "Comfortable"]
        $translated := labels
        if !english{translated =["打开工作区", "显示网格", "导出", "PNG 图片", "SVG 图片", "暂不可用", "保存", "视图密度", "紧凑", "舒适"]}
        $grid := widgets.menu_item(20, translated[1])
        grid.kind = widgets.MENU_CHECK
        $export := widgets.menu_item(30, translated[2])
        export.kind = widgets.MENU_SUBMENU
        $png := widgets.menu_item(31, translated[3])
        png.parent = 30
        $svg := widgets.menu_item(32, translated[4])
        svg.parent = 30
        $unavailable := widgets.menu_item(40, translated[5])
        unavailable.enabled = false
        $save := widgets.menu_item(50, translated[6])
        save.shortcut_key = 115
        save.shortcut_modifiers = ui.MOD_META
        save.shortcut_label = "⌘S"
        $separator := widgets.menu_item(60, "")
        separator.kind = widgets.MENU_SEPARATOR
        $heading := widgets.menu_item(70, translated[7])
        heading.kind = widgets.MENU_HEADING
        $compact := widgets.menu_item(80, translated[8])
        compact.kind = widgets.MENU_RADIO
        compact.radio_group = 1
        $comfortable := widgets.menu_item(81, translated[9])
        comfortable.kind = widgets.MENU_RADIO
        comfortable.radio_group = 1
        comfortable.checked = true
        <<[widgets.menu_item(10, translated[0]), grid, export, png, svg, unavailable, save, separator, heading, compact, comfortable]
    }
    
    fn chart_data(kind int, revision int)[]chart.ChartSeries{
        << chart_data_locale(kind, revision, true)
    }
    
    fn chart_data_locale(kind int, revision int, english bool)[]chart.ChartSeries{
        $result :=[]chart.ChartSeries{}
        $series_count := 2
        single := kind == widgets.CHART_DONUT || kind == widgets.CHART_PIE || kind == widgets.CHART_ROSE ||
            kind == widgets.CHART_GAUGE || kind == widgets.CHART_HISTOGRAM || kind == widgets.CHART_BOXPLOT ||
            kind == widgets.CHART_CANDLESTICK || kind == widgets.CHART_WATERFALL || kind == widgets.CHART_FUNNEL ||
            (kind >= widgets.CHART_POLAR_BAR && kind <= widgets.CHART_SANKEY) || kind == widgets.CHART_VIOLIN ||
            kind == widgets.CHART_BULLET || kind == widgets.CHART_DUMBBELL || kind == widgets.CHART_PARETO
        if single{series_count = 1}
        if kind == widgets.CHART_HEATMAP{series_count = 3}
        for si in 0:series_count{
            $name := "构建"
            if si == 1 {name = "索引"}
            if si == 2 {name = "绘制"}
            if single{name = "工作量"}
            if english {
                name = "Build"
                if si == 1 {name = "Index"}
                if si == 2 {name = "Render"}
                if single{name = "Workload"}
            }
            $series := chart.chart_series(si + 1, name, kind)
            series.smooth = kind == widgets.CHART_LINE || kind == widgets.CHART_AREA || kind == widgets.CHART_STACKED_AREA ||
                kind == widgets.CHART_SMOOTH_LINE || kind == widgets.CHART_SMOOTH_AREA
            $count := 12 - revision % 2
            if kind == widgets.CHART_SCATTER{count = 64}
            else if kind == widgets.CHART_BUBBLE{count = 16}
            else if kind == widgets.CHART_DONUT || kind == widgets.CHART_PIE || kind == widgets.CHART_ROSE ||
                    kind == widgets.CHART_FUNNEL || kind == widgets.CHART_TREEMAP || kind == widgets.CHART_SANKEY{count = 5}
            else if kind == widgets.CHART_RADAR || kind == widgets.CHART_PARETO{count = 6}
            else if kind == widgets.CHART_GAUGE{count = 3}
            else if kind == widgets.CHART_POLAR_BAR{count = 4}
            else if kind == widgets.CHART_HORIZONTAL_BAR || kind == widgets.CHART_HEATMAP || kind == widgets.CHART_BULLET ||
                    kind == widgets.CHART_LOLLIPOP || kind == widgets.CHART_DUMBBELL || kind == widgets.CHART_VIOLIN{count = 8}
            else if kind == widgets.CHART_WATERFALL{count = 7}
            for i in 0:count{
                x := f64(i + 1)
                phase := f64(revision) * 0.9 + f64(si) * 1.7
                $y := 48.0 + f64(si) * 20.0 + math.sin(x * 0.55 + phase) * 20.0 + math.cos(x * 0.17 + phase) * 7.0
                if kind == widgets.CHART_FUNNEL || kind == widgets.CHART_PARETO || kind == widgets.CHART_TREEMAP || kind == widgets.CHART_SANKEY{
                    y = f64((count - i) * 22 + (revision % 3) * 4)
                } else if kind == widgets.CHART_GAUGE || kind == widgets.CHART_POLAR_BAR{
                    y = math.max(12.0, math.min(96.0, 34.0 + f64(i) * 18.0 + math.sin(phase + x) * 14.0))
                } else if kind == widgets.CHART_WATERFALL{
                    deltas :=[42.0, 18.0, 0.0 - 14.0, 24.0, 0.0 - 11.0, 16.0, 0.0]
                    y = deltas[i] + math.sin(phase) * 3.0
                    if i == count - 1 {y = 0.0}
                }
                $point := chart.chart_point(i + 1, x, y)
                if kind == widgets.CHART_BUBBLE{
                    point = chart.chart_bubble_point(i + 1, x, y, 12.0 + math.abs(math.cos(x * 0.7 + phase)) * 36.0)
                } else if kind == widgets.CHART_BOXPLOT || kind == widgets.CHART_CANDLESTICK ||
                          kind == widgets.CHART_VIOLIN || kind == widgets.CHART_DUMBBELL || kind == widgets.CHART_BULLET{
                    $close := y + math.sin(x * 0.9 + phase) * 12.0
                    if (kind == widgets.CHART_BOXPLOT || kind == widgets.CHART_VIOLIN || kind == widgets.CHART_DUMBBELL || kind == widgets.CHART_BULLET) && close < y{
                        close = y + 10.0
                    }
                    low := math.min(y, close) - 8.0 - math.abs(math.cos(x + phase)) * 6.0
                    high := math.max(y, close) + 8.0 + math.abs(math.sin(x + phase)) * 6.0
                    point = chart.chart_range_point(i + 1, x, y, low, high, close)
                } else if kind == widgets.CHART_WATERFALL && i == count - 1 {
                    point.size = 1.0
                }
                if english {
                    point.label = "Sample " + str(i + 1)
                    if kind == widgets.CHART_DONUT || kind == widgets.CHART_PIE || kind == widgets.CHART_ROSE ||
                       kind == widgets.CHART_FUNNEL || kind == widgets.CHART_TREEMAP || kind == widgets.CHART_SANKEY{
                        point.label =["Compile", "Index", "Render", "I/O", "Other"][i]
                    } else if kind == widgets.CHART_RADAR{
                        point.label =["Throughput", "Latency", "Memory", "Startup", "Cache", "Binary"][i]
                    } else if kind == widgets.CHART_GAUGE{
                        point.label =["CPU", "Memory", "Cache"][i]
                    } else if kind == widgets.CHART_POLAR_BAR{
                        point.label =["Core 0", "Core 1", "Core 2", "Core 3"][i]
                    } else if kind == widgets.CHART_WATERFALL && i == count - 1 {
                        point.label = "Total"
                    }
                } else {
                    point.label = "样本 " + str(i + 1)
                    if kind == widgets.CHART_DONUT || kind == widgets.CHART_PIE || kind == widgets.CHART_ROSE ||
                       kind == widgets.CHART_FUNNEL || kind == widgets.CHART_TREEMAP || kind == widgets.CHART_SANKEY{
                        point.label =["编译", "索引", "绘制", "输入输出", "其他"][i]
                    } else if kind == widgets.CHART_RADAR{
                        point.label =["吞吐量", "延迟", "内存", "启动", "缓存", "体积"][i]
                    } else if kind == widgets.CHART_GAUGE{
                        point.label =["处理器", "内存", "缓存"][i]
                    } else if kind == widgets.CHART_POLAR_BAR{
                        point.label =["核心 0", "核心 1", "核心 2", "核心 3"][i]
                    } else if kind == widgets.CHART_WATERFALL && i == count - 1 {
                        point.label = "总计"
                    }
                }
                series.points.push(point)
            }
            result.push(series)
        }
        << result
    }

API declarations

const CHART_LINE

XuAPI
pub const CHART_LINE = 0

Purpose

Constant CHART_LINE, defining protocol or algorithm parameters.

See usage example

const CHART_AREA

XuAPI
pub const CHART_AREA = 1

Purpose

Constant CHART_AREA, defining protocol or algorithm parameters.

See usage example

const CHART_BAR

XuAPI
pub const CHART_BAR = 2

Purpose

Constant CHART_BAR, defining protocol or algorithm parameters.

const CHART_SCATTER

XuAPI
pub const CHART_SCATTER = 3

Purpose

Constant CHART_SCATTER, defining protocol or algorithm parameters.

See usage example

const CHART_DONUT

XuAPI
pub const CHART_DONUT = 4

Purpose

Constant CHART_DONUT, defining protocol or algorithm parameters.

See usage example

const CHART_STEP_LINE

XuAPI
pub const CHART_STEP_LINE = 5

Purpose

Constant CHART_STEP_LINE, defining protocol or algorithm parameters.

const CHART_STACKED_AREA

XuAPI
pub const CHART_STACKED_AREA = 6

Purpose

Constant CHART_STACKED_AREA, defining protocol or algorithm parameters.

See usage example

const CHART_STACKED_BAR

XuAPI
pub const CHART_STACKED_BAR = 7

Purpose

Constant CHART_STACKED_BAR, defining protocol or algorithm parameters.

const CHART_HORIZONTAL_BAR

XuAPI
pub const CHART_HORIZONTAL_BAR = 8

Purpose

Constant CHART_HORIZONTAL_BAR, defining protocol or algorithm parameters.

See usage example

const CHART_PIE

XuAPI
pub const CHART_PIE = 9

Purpose

Constant CHART_PIE, defining protocol or algorithm parameters.

See usage example

const CHART_ROSE

XuAPI
pub const CHART_ROSE = 10

Purpose

Constant CHART_ROSE, defining protocol or algorithm parameters.

See usage example

const CHART_RADAR

XuAPI
pub const CHART_RADAR = 11

Purpose

Constant CHART_RADAR, defining protocol or algorithm parameters.

See usage example

const CHART_GAUGE

XuAPI
pub const CHART_GAUGE = 12

Purpose

Constant CHART_GAUGE, defining protocol or algorithm parameters.

See usage example

const CHART_BUBBLE

XuAPI
pub const CHART_BUBBLE = 13

Purpose

Constant CHART_BUBBLE, defining protocol or algorithm parameters.

See usage example

const CHART_HISTOGRAM

XuAPI
pub const CHART_HISTOGRAM = 14

Purpose

Constant CHART_HISTOGRAM, defining protocol or algorithm parameters.

See usage example

const CHART_BOXPLOT

XuAPI
pub const CHART_BOXPLOT = 15

Purpose

Constant CHART_BOXPLOT, defining protocol or algorithm parameters.

See usage example

const CHART_HEATMAP

XuAPI
pub const CHART_HEATMAP = 16

Purpose

Constant CHART_HEATMAP, defining protocol or algorithm parameters.

See usage example

const CHART_CANDLESTICK

XuAPI
pub const CHART_CANDLESTICK = 17

Purpose

Constant CHART_CANDLESTICK, defining protocol or algorithm parameters.

See usage example

const CHART_WATERFALL

XuAPI
pub const CHART_WATERFALL = 18

Purpose

Constant CHART_WATERFALL, defining protocol or algorithm parameters.

See usage example

const CHART_FUNNEL

XuAPI
pub const CHART_FUNNEL = 19

Purpose

Constant CHART_FUNNEL, defining protocol or algorithm parameters.

See usage example

const CHART_SMOOTH_LINE

XuAPI
pub const CHART_SMOOTH_LINE = 20

Purpose

Constant CHART_SMOOTH_LINE, defining protocol or algorithm parameters.

See usage example

const CHART_SMOOTH_AREA

XuAPI
pub const CHART_SMOOTH_AREA = 21

Purpose

Constant CHART_SMOOTH_AREA, defining protocol or algorithm parameters.

See usage example

const CHART_POLAR_BAR

XuAPI
pub const CHART_POLAR_BAR = 22

Purpose

Constant CHART_POLAR_BAR, defining protocol or algorithm parameters.

See usage example

const CHART_TREEMAP

XuAPI
pub const CHART_TREEMAP = 23

Purpose

Constant CHART_TREEMAP, defining protocol or algorithm parameters.

See usage example

const CHART_SANKEY

XuAPI
pub const CHART_SANKEY = 24

Purpose

Constant CHART_SANKEY, defining protocol or algorithm parameters.

See usage example

const CHART_VIOLIN

XuAPI
pub const CHART_VIOLIN = 25

Purpose

Constant CHART_VIOLIN, defining protocol or algorithm parameters.

See usage example

const CHART_BULLET

XuAPI
pub const CHART_BULLET = 26

Purpose

Constant CHART_BULLET, defining protocol or algorithm parameters.

See usage example

const CHART_LOLLIPOP

XuAPI
pub const CHART_LOLLIPOP = 27

Purpose

Constant CHART_LOLLIPOP, defining protocol or algorithm parameters.

See usage example

const CHART_DUMBBELL

XuAPI
pub const CHART_DUMBBELL = 28

Purpose

Constant CHART_DUMBBELL, defining protocol or algorithm parameters.

See usage example

const CHART_PARETO

XuAPI
pub const CHART_PARETO = 29

Purpose

Constant CHART_PARETO, defining protocol or algorithm parameters.

See usage example

const ACTION_CHART_HOVER

XuAPI
pub const ACTION_CHART_HOVER = 40

Purpose

Constant ACTION_CHART_HOVER, defining protocol or algorithm parameters.

See usage example

const ACTION_CHART_SELECT

XuAPI
pub const ACTION_CHART_SELECT = 41

Purpose

Constant ACTION_CHART_SELECT, defining protocol or algorithm parameters.

See usage example

const ACTION_CHART_VIEWPORT

XuAPI
pub const ACTION_CHART_VIEWPORT = 42

Purpose

Constant ACTION_CHART_VIEWPORT, defining protocol or algorithm parameters.

See usage example

const ACTION_CHART_LEGEND

XuAPI
pub const ACTION_CHART_LEGEND = 43

Purpose

Constant ACTION_CHART_LEGEND, defining protocol or algorithm parameters.

chart_appearance

XuAPI
pub fn chart_appearance() chart.ChartAppearance

Purpose

Chart appearance.

Parameters

No arguments are required.

Returns

chart.ChartAppearance — a value of this type

chart_series

XuAPI
pub fn chart_series(id int,name string,kind int) chart.ChartSeries

Purpose

Chart series.

Parameters

id int
id (int)
name string
name (string)
kind int
kind tag (int)

Returns

chart.ChartSeries — a value of this type

chart_point

XuAPI
pub fn chart_point(id int,x f64,y f64) chart.ChartPoint

Purpose

Chart point.

Parameters

id int
id (int)
x f64
value (f64)
y f64
value (f64)

Returns

chart.ChartPoint — a value of this type

chart_domain

XuAPI
pub fn chart_domain(x_min f64,x_max f64,y_min f64,y_max f64) chart.ChartDomain

Purpose

Chart domain.

Parameters

x_min f64
x_min (f64)
x_max f64
x_max (f64)
y_min f64
y_min (f64)
y_max f64
y_max (f64)

Returns

chart.ChartDomain — a value of this type

const ACTION_NONE

XuAPI
pub const ACTION_NONE = 0

Purpose

Persistent control state is separate from text shaping and frame recording. The caller owns the TextLayout and acknowledges paint only after present succeeds.

See usage example

const ACTION_ACTIVATE

XuAPI
pub const ACTION_ACTIVATE = 1

Purpose

Constant ACTION_ACTIVATE, defining protocol or algorithm parameters.

See usage example

const ACTION_CHANGE

XuAPI
pub const ACTION_CHANGE = 2

Purpose

Constant ACTION_CHANGE, defining protocol or algorithm parameters.

See usage example

const ACTION_SCROLL

XuAPI
pub const ACTION_SCROLL = 3

Purpose

Constant ACTION_SCROLL, defining protocol or algorithm parameters.

See usage example

const ACTION_COMMIT

XuAPI
pub const ACTION_COMMIT = 8

Purpose

Constant ACTION_COMMIT, defining protocol or algorithm parameters.

See usage example

struct Action

XuAPI
pub struct Action {
    pub kind int
    pub id int
    pub needs_paint bool
    pub request_focus bool
    pub consumed bool
    pub value f64
}

Purpose

Structure encapsulating kind, id, needs_paint, request_focus, consumed.

Public fields

kind int
kind tag
id int
field (int)
needs_paint bool
field (bool)
request_focus bool
field (bool)
consumed bool
field (bool)
value f64
field (f64)

See usage example

struct Theme

XuAPI
pub struct Theme {
    pub normal draw.Color
    pub hovered draw.Color
    pub pressed draw.Color
    pub disabled draw.Color
    pub foreground draw.Color
    pub muted draw.Color
    pub accent draw.Color
    pub focus draw.Color
}

Purpose

Structure encapsulating normal, hovered, pressed, disabled, foreground.

Public fields

normal draw.Color
field (draw.Color)
hovered draw.Color
field (draw.Color)
pressed draw.Color
field (draw.Color)
disabled draw.Color
field (draw.Color)
foreground draw.Color
field (draw.Color)
muted draw.Color
field (draw.Color)
accent draw.Color
field (draw.Color)
focus draw.Color
field (draw.Color)

See usage example

default_theme

XuAPI
pub fn default_theme() Theme

Purpose

Default theme.

Parameters

No arguments are required.

Returns

Theme — a value of this type

See usage example

belongs

XuAPI
pub fn belongs(identity &ui.CanvasEvent,input &ui.InputEvent) bool

Purpose

Execute belongs.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

bool — true or false

copy_rect

XuAPI
pub fn copy_rect(bounds &layout.Rect) layout.Rect

Purpose

Copy rectangle.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

layout.Rect — a value of this type

copy_identity

XuAPI
pub fn copy_identity(identity &ui.CanvasEvent) ui.CanvasEvent

Purpose

Copy identity.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)

Returns

ui.CanvasEvent — a value of this type

no_action

XuAPI
pub fn no_action(id int,dirty bool) Action

Purpose

No action.

Parameters

id int
id (int)
dirty bool
dirty (bool)

Returns

Action — input result with kind, id, repaint and focus requests.

struct Button

XuAPI
pub struct Button {

}

Purpose

Button context or state structure.

Public fields

This type has no public fields.

See usage example

button

XuAPI
pub fn button(identity &ui.CanvasEvent,id int,bounds &layout.Rect) Button

Purpose

Execute button. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Button — a value of this type

See usage example

(&Button) id

XuAPI
pub fn (button &Button) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

int — a value of this type

(&Button) is_closed

XuAPI
pub fn (button &Button) is_closed() bool

Purpose

Operation on &Button: whether it is closed.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

($&Button) close

XuAPI
pub fn (button $&Button) close()

Purpose

Operation on $&Button: close the resource.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Button) identity

XuAPI
pub fn (button &Button) identity() ui.CanvasEvent

Purpose

Execute identity on &Button.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

ui.CanvasEvent — a value of this type

(&Button) needs_paint

XuAPI
pub fn (button &Button) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_focused

XuAPI
pub fn (button &Button) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_enabled

XuAPI
pub fn (button &Button) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_selectable

XuAPI
pub fn (button &Button) is_selectable() bool

Purpose

Operation on &Button: whether it is selectable.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

($&Button) set_selectable

XuAPI
pub fn (button $&Button) set_selectable(selectable bool)

Purpose

Operation on $&Button: set selectable.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Button) bounds

XuAPI
pub fn (button &Button) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Button) painted

XuAPI
pub fn (button $&Button) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Button) invalidate

XuAPI
pub fn (button $&Button) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Button) cancel

XuAPI
pub fn (button $&Button) cancel()

Purpose

Execute cancel on $&Button.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Button) set_enabled

XuAPI
pub fn (button $&Button) set_enabled(enabled bool)

Purpose

Operation on $&Button: set enabled.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Button) set_focus

XuAPI
pub fn (button $&Button) set_focus(focused bool)

Purpose

Operation on $&Button: set focus.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Button) set_bounds

XuAPI
pub fn (button $&Button) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Button: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Button) input

XuAPI
pub fn (button $&Button) input(input &ui.InputEvent) Action

Purpose

Process button presses, releases and keyboard activation; perform the business action on a completed activation.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
input &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • Pressing and releasing inside, or pressing and releasing Enter/Space while focused, yields ACTION_ACTIVATE; read-only buttons do not activate.

($&Button) event

XuAPI
pub fn (button $&Button) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

button_size

XuAPI
pub fn button_size(label &draw.TextLayout) layout.Size

Purpose

Button size.

Parameters

label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)

Returns

layout.Size — a value of this type

(&Button) paint

XuAPI
pub fn (button &Button) paint(frame $&draw.Frame,label &draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

button &Button
The Button instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

struct Checkbox

XuAPI
pub struct Checkbox {

}

Purpose

Checkbox context or state structure.

Public fields

This type has no public fields.

See usage example

checkbox

XuAPI
pub fn checkbox(identity &ui.CanvasEvent,id int,bounds &layout.Rect,checked bool) Checkbox

Purpose

Execute checkbox. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
checked bool
checked (bool)

Returns

Checkbox — a value of this type

See usage example

($&Checkbox) set_focus

XuAPI
pub fn (checkbox $&Checkbox) set_focus(focused bool)

Purpose

Operation on $&Checkbox: set focus.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Checkbox) set_enabled

XuAPI
pub fn (checkbox $&Checkbox) set_enabled(enabled bool)

Purpose

Operation on $&Checkbox: set enabled.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Checkbox) set_bounds

XuAPI
pub fn (checkbox $&Checkbox) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Checkbox: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Checkbox) needs_paint

XuAPI
pub fn (checkbox &Checkbox) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

($&Checkbox) painted

XuAPI
pub fn (checkbox $&Checkbox) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Checkbox) is_selectable

XuAPI
pub fn (checkbox &Checkbox) is_selectable() bool

Purpose

Operation on &Checkbox: whether it is selectable.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

($&Checkbox) set_selectable

XuAPI
pub fn (checkbox $&Checkbox) set_selectable(selectable bool)

Purpose

Operation on $&Checkbox: set selectable.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Checkbox) value

XuAPI
pub fn (checkbox &Checkbox) value() bool

Purpose

Execute value on &Checkbox.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

(&Checkbox) is_indeterminate

XuAPI
pub fn (checkbox &Checkbox) is_indeterminate() bool

Purpose

Operation on &Checkbox: whether it is indeterminate.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

($&Checkbox) set_indeterminate

XuAPI
pub fn (checkbox $&Checkbox) set_indeterminate(mixed bool)

Purpose

Operation on $&Checkbox: set indeterminate.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
mixed bool
mixed (bool)

Returns

This call does not return a value.

($&Checkbox) set_value

XuAPI
pub fn (checkbox $&Checkbox) set_value(checked bool)

Purpose

Set a checkbox's checked state and clear indeterminate state from application data.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
checked bool
Checked state to display.

Returns

No return value; a state change marks repainting without generating a user input action.

($&Checkbox) input

XuAPI
pub fn (checkbox $&Checkbox) input(input &ui.InputEvent) Action

Purpose

Process checkbox interaction and update its checked state when activated.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
input &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • A change yields ACTION_CHANGE, with value 1.0 for checked or 0.0 for unchecked; activating an indeterminate box checks it.

($&Checkbox) event

XuAPI
pub fn (checkbox $&Checkbox) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Checkbox) paint

XuAPI
pub fn (checkbox &Checkbox) paint(frame $&draw.Frame,label &draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

struct Progress

XuAPI
pub struct Progress {

}

Purpose

Progress context or state structure.

Public fields

This type has no public fields.

See usage example

progress

XuAPI
pub fn progress(bounds &layout.Rect,value f64) Progress

Purpose

Execute progress. Throws on failure; handle the error or propagate it to the caller.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value f64
value (f64)

Returns

Progress — a value of this type

See usage example

(&Progress) value

XuAPI
pub fn (progress &Progress) value() f64

Purpose

Execute value on &Progress.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

f64 — a value of this type

(&Progress) needs_paint

XuAPI
pub fn (progress &Progress) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

($&Progress) painted

XuAPI
pub fn (progress $&Progress) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Progress) is_selectable

XuAPI
pub fn (progress &Progress) is_selectable() bool

Purpose

Operation on &Progress: whether it is selectable.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

($&Progress) set_selectable

XuAPI
pub fn (progress $&Progress) set_selectable(selectable bool)

Purpose

Operation on $&Progress: set selectable.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Progress) set_value

XuAPI
pub fn (progress $&Progress) set_value(value f64) int

Purpose

Operation on $&Progress: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
value f64
value (f64)

Returns

int — a value of this type

($&Progress) set_bounds

XuAPI
pub fn (progress $&Progress) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Progress: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Progress) paint

XuAPI
pub fn (progress &Progress) paint(frame $&draw.Frame,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

progress &Progress
The Progress instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

struct Host

XuAPI
pub struct Host {
    pub context draw.Context
    pub identity ui.CanvasEvent
}

Purpose

A widget surface uses logical coordinates and handles scrolling itself.

Public fields

context draw.Context
field (draw.Context)
identity ui.CanvasEvent
field (ui.CanvasEvent)

See usage example

attach

XuAPI
pub fn attach(window &ui.Window) Host

Purpose

Execute attach. Throws on failure; handle the error or propagate it to the caller.

Parameters

window &ui.Window
window (read-only borrow; caller keeps the original; type &ui.Window)

Returns

Host — a value of this type

const ROLE_NONE

XuAPI
pub const ROLE_NONE = 0

Purpose

Accessibility node roles — a semantic abstraction of control type for platform providers (UIA, NSAccessibility, AT-SPI2). Each role maps directly to a platform control type or pattern.

const ROLE_WINDOW

XuAPI
pub const ROLE_WINDOW = 1

Purpose

Constant ROLE_WINDOW, defining protocol or algorithm parameters.

const ROLE_GROUP

XuAPI
pub const ROLE_GROUP = 2

Purpose

Constant ROLE_GROUP, defining protocol or algorithm parameters.

const ROLE_BUTTON

XuAPI
pub const ROLE_BUTTON = 3

Purpose

Constant ROLE_BUTTON, defining protocol or algorithm parameters.

const ROLE_CHECKBOX

XuAPI
pub const ROLE_CHECKBOX = 4

Purpose

Constant ROLE_CHECKBOX, defining protocol or algorithm parameters.

const ROLE_SWITCH

XuAPI
pub const ROLE_SWITCH = 5

Purpose

Constant ROLE_SWITCH, defining protocol or algorithm parameters.

const ROLE_RADIO_BUTTON

XuAPI
pub const ROLE_RADIO_BUTTON = 6

Purpose

Constant ROLE_RADIO_BUTTON, defining protocol or algorithm parameters.

const ROLE_TEXT_FIELD

XuAPI
pub const ROLE_TEXT_FIELD = 7

Purpose

Constant ROLE_TEXT_FIELD, defining protocol or algorithm parameters.

const ROLE_TEXT_AREA

XuAPI
pub const ROLE_TEXT_AREA = 8

Purpose

Constant ROLE_TEXT_AREA, defining protocol or algorithm parameters.

const ROLE_LABEL

XuAPI
pub const ROLE_LABEL = 9

Purpose

Constant ROLE_LABEL, defining protocol or algorithm parameters.

const ROLE_SLIDER

XuAPI
pub const ROLE_SLIDER = 10

Purpose

Constant ROLE_SLIDER, defining protocol or algorithm parameters.

const ROLE_STEPPER

XuAPI
pub const ROLE_STEPPER = 11

Purpose

Constant ROLE_STEPPER, defining protocol or algorithm parameters.

const ROLE_TAB_LIST

XuAPI
pub const ROLE_TAB_LIST = 12

Purpose

Constant ROLE_TAB_LIST, defining protocol or algorithm parameters.

const ROLE_TAB

XuAPI
pub const ROLE_TAB = 13

Purpose

Constant ROLE_TAB, defining protocol or algorithm parameters.

const ROLE_TAB_PANEL

XuAPI
pub const ROLE_TAB_PANEL = 14

Purpose

Constant ROLE_TAB_PANEL, defining protocol or algorithm parameters.

const ROLE_SELECT

XuAPI
pub const ROLE_SELECT = 15

Purpose

Constant ROLE_SELECT, defining protocol or algorithm parameters.

const ROLE_LIST

XuAPI
pub const ROLE_LIST = 16

Purpose

Constant ROLE_LIST, defining protocol or algorithm parameters.

const ROLE_LIST_ITEM

XuAPI
pub const ROLE_LIST_ITEM = 17

Purpose

Constant ROLE_LIST_ITEM, defining protocol or algorithm parameters.

const ROLE_TABLE

XuAPI
pub const ROLE_TABLE = 18

Purpose

Constant ROLE_TABLE, defining protocol or algorithm parameters.

const ROLE_TABLE_ROW

XuAPI
pub const ROLE_TABLE_ROW = 19

Purpose

Constant ROLE_TABLE_ROW, defining protocol or algorithm parameters.

const ROLE_TABLE_CELL

XuAPI
pub const ROLE_TABLE_CELL = 20

Purpose

Constant ROLE_TABLE_CELL, defining protocol or algorithm parameters.

const ROLE_TABLE_HEADER

XuAPI
pub const ROLE_TABLE_HEADER = 21

Purpose

Constant ROLE_TABLE_HEADER, defining protocol or algorithm parameters.

const ROLE_TREE

XuAPI
pub const ROLE_TREE = 22

Purpose

Constant ROLE_TREE, defining protocol or algorithm parameters.

const ROLE_TREE_ITEM

XuAPI
pub const ROLE_TREE_ITEM = 23

Purpose

Constant ROLE_TREE_ITEM, defining protocol or algorithm parameters.

const ROLE_PROGRESS_BAR

XuAPI
pub const ROLE_PROGRESS_BAR = 24

Purpose

Constant ROLE_PROGRESS_BAR, defining protocol or algorithm parameters.

const ROLE_SEPARATOR

XuAPI
pub const ROLE_SEPARATOR = 25

Purpose

Constant ROLE_SEPARATOR, defining protocol or algorithm parameters.

const ROLE_MENU

XuAPI
pub const ROLE_MENU = 26

Purpose

Constant ROLE_MENU, defining protocol or algorithm parameters.

const ROLE_MENU_ITEM

XuAPI
pub const ROLE_MENU_ITEM = 27

Purpose

Constant ROLE_MENU_ITEM, defining protocol or algorithm parameters.

const ROLE_DIALOG

XuAPI
pub const ROLE_DIALOG = 28

Purpose

Constant ROLE_DIALOG, defining protocol or algorithm parameters.

const ROLE_TOOLTIP

XuAPI
pub const ROLE_TOOLTIP = 29

Purpose

Constant ROLE_TOOLTIP, defining protocol or algorithm parameters.

const ROLE_TOOLBAR

XuAPI
pub const ROLE_TOOLBAR = 30

Purpose

Constant ROLE_TOOLBAR, defining protocol or algorithm parameters.

const ROLE_SCROLL_BAR

XuAPI
pub const ROLE_SCROLL_BAR = 31

Purpose

Constant ROLE_SCROLL_BAR, defining protocol or algorithm parameters.

const ROLE_BREADCRUMB

XuAPI
pub const ROLE_BREADCRUMB = 32

Purpose

Constant ROLE_BREADCRUMB, defining protocol or algorithm parameters.

const ROLE_BADGE

XuAPI
pub const ROLE_BADGE = 34

Purpose

Constant ROLE_BADGE, defining protocol or algorithm parameters.

const ROLE_CARD

XuAPI
pub const ROLE_CARD = 35

Purpose

Constant ROLE_CARD, defining protocol or algorithm parameters.

const ROLE_CHART

XuAPI
pub const ROLE_CHART = 36

Purpose

Constant ROLE_CHART, defining protocol or algorithm parameters.

const ROLE_COLOR_PICKER

XuAPI
pub const ROLE_COLOR_PICKER = 37

Purpose

Constant ROLE_COLOR_PICKER, defining protocol or algorithm parameters.

const ROLE_DATE_PICKER

XuAPI
pub const ROLE_DATE_PICKER = 38

Purpose

Constant ROLE_DATE_PICKER, defining protocol or algorithm parameters.

const ROLE_TIME_PICKER

XuAPI
pub const ROLE_TIME_PICKER = 39

Purpose

Constant ROLE_TIME_PICKER, defining protocol or algorithm parameters.

const ROLE_SPINNER

XuAPI
pub const ROLE_SPINNER = 40

Purpose

Constant ROLE_SPINNER, defining protocol or algorithm parameters.

const ROLE_COMBOBOX

XuAPI
pub const ROLE_COMBOBOX = 41

Purpose

Constant ROLE_COMBOBOX, defining protocol or algorithm parameters.

const ROLE_SPLIT_VIEW

XuAPI
pub const ROLE_SPLIT_VIEW = 42

Purpose

Constant ROLE_SPLIT_VIEW, defining protocol or algorithm parameters.

const ROLE_WEBVIEW

XuAPI
pub const ROLE_WEBVIEW = 43

Purpose

Constant ROLE_WEBVIEW, defining protocol or algorithm parameters.

const ROLE_PASSWORD_FIELD

XuAPI
pub const ROLE_PASSWORD_FIELD = 44

Purpose

Constant ROLE_PASSWORD_FIELD, defining protocol or algorithm parameters.

const ROLE_POPOVER

XuAPI
pub const ROLE_POPOVER = 45

Purpose

Constant ROLE_POPOVER, defining protocol or algorithm parameters.

const ROLE_TOAST

XuAPI
pub const ROLE_TOAST = 46

Purpose

Constant ROLE_TOAST, defining protocol or algorithm parameters.

const ACC_STATE_DISABLED

XuAPI
pub const ACC_STATE_DISABLED = 1

Purpose

Accessibility node states — a bitmask of boolean properties. States are orthogonal and not role-dependent at the node model layer.

const ACC_STATE_FOCUSED

XuAPI
pub const ACC_STATE_FOCUSED = 2

Purpose

Constant ACC_STATE_FOCUSED, defining protocol or algorithm parameters.

const ACC_STATE_SELECTED

XuAPI
pub const ACC_STATE_SELECTED = 4

Purpose

Constant ACC_STATE_SELECTED, defining protocol or algorithm parameters.

const ACC_STATE_CHECKED

XuAPI
pub const ACC_STATE_CHECKED = 8

Purpose

Constant ACC_STATE_CHECKED, defining protocol or algorithm parameters.

const ACC_STATE_EXPANDED

XuAPI
pub const ACC_STATE_EXPANDED = 16

Purpose

Constant ACC_STATE_EXPANDED, defining protocol or algorithm parameters.

const ACC_STATE_COLLAPSED

XuAPI
pub const ACC_STATE_COLLAPSED = 32

Purpose

Constant ACC_STATE_COLLAPSED, defining protocol or algorithm parameters.

const ACC_STATE_READ_ONLY

XuAPI
pub const ACC_STATE_READ_ONLY = 64

Purpose

Constant ACC_STATE_READ_ONLY, defining protocol or algorithm parameters.

const ACC_STATE_REQUIRED

XuAPI
pub const ACC_STATE_REQUIRED = 128

Purpose

Constant ACC_STATE_REQUIRED, defining protocol or algorithm parameters.

const ACC_STATE_INVALID

XuAPI
pub const ACC_STATE_INVALID = 256

Purpose

Constant ACC_STATE_INVALID, defining protocol or algorithm parameters.

const ACC_STATE_BUSY

XuAPI
pub const ACC_STATE_BUSY = 512

Purpose

Constant ACC_STATE_BUSY, defining protocol or algorithm parameters.

const ACC_STATE_PRESSED

XuAPI
pub const ACC_STATE_PRESSED = 1024

Purpose

Constant ACC_STATE_PRESSED, defining protocol or algorithm parameters.

const ACC_STATE_MODAL

XuAPI
pub const ACC_STATE_MODAL = 2048

Purpose

Constant ACC_STATE_MODAL, defining protocol or algorithm parameters.

const ACC_STATE_HIDDEN

XuAPI
pub const ACC_STATE_HIDDEN = 4096

Purpose

Constant ACC_STATE_HIDDEN, defining protocol or algorithm parameters.

const ACC_STATE_INDETERMINATE

XuAPI
pub const ACC_STATE_INDETERMINATE = 8192

Purpose

Constant ACC_STATE_INDETERMINATE, defining protocol or algorithm parameters.

const ACC_STATE_PASSWORD

XuAPI
pub const ACC_STATE_PASSWORD = 16384

Purpose

Constant ACC_STATE_PASSWORD, defining protocol or algorithm parameters.

const ACC_STATE_MULTILINE

XuAPI
pub const ACC_STATE_MULTILINE = 32768

Purpose

Constant ACC_STATE_MULTILINE, defining protocol or algorithm parameters.

const LIVE_OFF

XuAPI
pub const LIVE_OFF = 0

Purpose

Live region semantics for status announcements.

const LIVE_POLITE

XuAPI
pub const LIVE_POLITE = 1

Purpose

Constant LIVE_POLITE, defining protocol or algorithm parameters.

const LIVE_ASSERTIVE

XuAPI
pub const LIVE_ASSERTIVE = 2

Purpose

Constant LIVE_ASSERTIVE, defining protocol or algorithm parameters.

const MAX_ACCESSIBILITY_NODES

XuAPI
pub const MAX_ACCESSIBILITY_NODES = 512

Purpose

Constant MAX_ACCESSIBILITY_NODES, defining protocol or algorithm parameters.

const MAX_ACCESSIBILITY_TEXT

XuAPI
pub const MAX_ACCESSIBILITY_TEXT = 65536

Purpose

Constant MAX_ACCESSIBILITY_TEXT, defining protocol or algorithm parameters.

struct AccessibilityNode

XuAPI
pub struct AccessibilityNode {
    pub id int
    pub role int
    pub parent int
    pub name string
    pub description string
    pub value string
    pub selected_text string
    pub copy_enabled bool
    pub states int
    pub live int
    pub x f64
    pub y f64
    pub width f64
    pub height f64
    pub value_min f64
    pub value_max f64
    pub value_now f64
    pub row_index int
    pub row_count int
    pub column_index int
    pub column_count int
    pub level int
    pub children []int
}

Purpose

An AccessibilityNode captures the semantic information a platform accessibility provider (UIA, NSAccessibility, AT-SPI2) needs to describe a single element to assistive technology. It is a value type — providers receive a snapshot, not a mutable reference.

Public fields

id int
field (int)
role int
field (int)
parent int
field (int)
name string
name
description string
field (string)
value string
field (string)
selected_text string
Selected substring available for copy / TextPattern GetSelection. Empty when the node has no selection, copy is disabled, or must not export text (password).
copy_enabled bool
Whether clipboard copy is allowed for this node. False for passwords and when the app disabled copy.
states int
field (int)
live int
field (int)
x f64
value
y f64
value
width f64
field (f64)
height f64
field (f64)
value_min f64
Range value properties (for SLIDER, STEPPER, PROGRESS_BAR, SCROLL_BAR).
value_max f64
field (f64)
value_now f64
field (f64)
row_index int
Table/tree position metadata.
row_count int
field (int)
column_index int
field (int)
column_count int
field (int)
level int
field (int)
children []int
Child ordering hint — sequential child ids for tree traversal.

($&Screen) accessibility_tree

XuAPI
pub fn (s $&Screen) accessibility_tree() []AccessibilityNode

Purpose

accessibility_tree builds a snapshot of semantic accessibility nodes from the Screen's current xacp_tree. This is the bridge between the widget tree (XACP) and platform-specific accessibility providers. The caller passes the result to a platform adapter (UIA provider, NSAccessibility, AT-SPI2) which holds a reference until the next update. The tree is rebuilt on each layout pass; providers compare against the previous snapshot to fire change notifications. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

[]AccessibilityNode — slice result

(&AccessibilityNode) clone

XuAPI
pub fn (node &AccessibilityNode) clone() AccessibilityNode

Purpose

Copy the control or style snapshot into an independent AccessibilityNode value.

Parameters

node &AccessibilityNode
The AccessibilityNode instance used by this call (borrow).

Returns

AccessibilityNode — a value of this type

accessibility_node_by_id

XuAPI
pub fn accessibility_node_by_id(tree &[]AccessibilityNode, id int) AccessibilityNode

Purpose

accessibility_node_by_id returns the node with the given id, or throws. Throws on failure; handle the error or propagate it to the caller.

Parameters

tree &[]AccessibilityNode
tree (read-only borrow; caller keeps the original; type &[]AccessibilityNode)
id int
id (int)

Returns

AccessibilityNode — a value of this type

(&AccessibilityNode) has_state

XuAPI
pub fn (node &AccessibilityNode) has_state(state int) bool

Purpose

has_state checks whether a specific state bit is set on a node.

Parameters

node &AccessibilityNode
The AccessibilityNode instance used by this call (borrow).
state int
state (int)

Returns

bool — true or false

role_name

XuAPI
pub fn role_name(role int) string

Purpose

role_name returns a human-readable string for a role constant. Platform providers use this for debugging; screen readers use their own localized role names.

Parameters

role int
role (int)

Returns

string — result string

const CHANGE_ADDED

XuAPI
pub const CHANGE_ADDED = 1

Purpose

Constant CHANGE_ADDED, defining protocol or algorithm parameters.

const CHANGE_REMOVED

XuAPI
pub const CHANGE_REMOVED = 2

Purpose

Constant CHANGE_REMOVED, defining protocol or algorithm parameters.

const CHANGE_NAME

XuAPI
pub const CHANGE_NAME = 4

Purpose

Constant CHANGE_NAME, defining protocol or algorithm parameters.

const CHANGE_VALUE

XuAPI
pub const CHANGE_VALUE = 8

Purpose

Constant CHANGE_VALUE, defining protocol or algorithm parameters.

const CHANGE_STATES

XuAPI
pub const CHANGE_STATES = 16

Purpose

Constant CHANGE_STATES, defining protocol or algorithm parameters.

const CHANGE_BOUNDS

XuAPI
pub const CHANGE_BOUNDS = 32

Purpose

Constant CHANGE_BOUNDS, defining protocol or algorithm parameters.

const CHANGE_FOCUS

XuAPI
pub const CHANGE_FOCUS = 64

Purpose

Constant CHANGE_FOCUS, defining protocol or algorithm parameters.

const CHANGE_CHILDREN

XuAPI
pub const CHANGE_CHILDREN = 128

Purpose

Constant CHANGE_CHILDREN, defining protocol or algorithm parameters.

const CHANGE_ROLE

XuAPI
pub const CHANGE_ROLE = 256

Purpose

Constant CHANGE_ROLE, defining protocol or algorithm parameters.

const CHANGE_LIVE_REGION

XuAPI
pub const CHANGE_LIVE_REGION = 512

Purpose

Constant CHANGE_LIVE_REGION, defining protocol or algorithm parameters.

struct AccessibilityChange

XuAPI
pub struct AccessibilityChange {
    pub id int
    pub kind int
    pub role int
    pub name string
}

Purpose

Structure encapsulating id, kind, role, name.

Public fields

id int
field (int)
kind int
kind tag
role int
field (int)
name string
name

diff_accessibility_trees

XuAPI
pub fn diff_accessibility_trees(old &[]AccessibilityNode, new &[]AccessibilityNode) []AccessibilityChange

Purpose

diff_accessibility_trees compares two snapshots and returns a list of changes. Platform providers use this to fire targeted notifications. This is deliberately conservative: it compares all fields a screen reader uses. If a change is detected that does not map to a platform notification, it is still included so adapters can choose to rebuild.

Parameters

old &[]AccessibilityNode
old value / piece to replace (read-only borrow; caller keeps the original; type &[]AccessibilityNode)
new &[]AccessibilityNode
new value / replacement (read-only borrow; caller keeps the original; type &[]AccessibilityNode)

Returns

[]AccessibilityChange — slice result

focused_node

XuAPI
pub fn focused_node(tree &[]AccessibilityNode) int

Purpose

focused_node returns the id of the currently focused accessibility node, or 0 if no node is focused.

Parameters

tree &[]AccessibilityNode
tree (read-only borrow; caller keeps the original; type &[]AccessibilityNode)

Returns

int — a value of this type

(&AccessibilityChange) has_change

XuAPI
pub fn (change &AccessibilityChange) has_change(flag int) bool

Purpose

has_change checks whether a specific change type is included.

Parameters

change &AccessibilityChange
The AccessibilityChange instance used by this call (borrow).
flag int
flag (int)

Returns

bool — true or false

const ANIMATION_IDLE

XuAPI
pub const ANIMATION_IDLE = 0

Purpose

Constant ANIMATION_IDLE, defining protocol or algorithm parameters.

const ANIMATION_RUNNING

XuAPI
pub const ANIMATION_RUNNING = 1

Purpose

Constant ANIMATION_RUNNING, defining protocol or algorithm parameters.

const ANIMATION_PAUSED

XuAPI
pub const ANIMATION_PAUSED = 2

Purpose

Constant ANIMATION_PAUSED, defining protocol or algorithm parameters.

const ANIMATION_FINISHED

XuAPI
pub const ANIMATION_FINISHED = 3

Purpose

Constant ANIMATION_FINISHED, defining protocol or algorithm parameters.

struct AnimationOptions

XuAPI
pub struct AnimationOptions {
    pub duration time.Duration
    pub delay time.Duration
    pub iterations int
    pub alternate bool
    pub curve int
    pub rate f64
}

Purpose

A clock-driven, reusable timeline. Zero iterations means repeat indefinitely. The owner schedules next_tick and applies value to its own visual state.

Public fields

duration time.Duration
field (time.Duration)
delay time.Duration
field (time.Duration)
iterations int
field (int)
alternate bool
field (bool)
curve int
field (int)
rate f64
field (f64)

animation_options

XuAPI
pub fn animation_options() AnimationOptions

Purpose

Animation options.

Parameters

No arguments are required.

Returns

AnimationOptions — a value of this type

See usage example

(&AnimationOptions) validate

XuAPI
pub fn (options &AnimationOptions) validate() int

Purpose

Execute validate on &AnimationOptions. Throws on failure; handle the error or propagate it to the caller.

Parameters

options &AnimationOptions
The AnimationOptions instance used by this call (borrow).

Returns

int — a value of this type

struct AnimationController

XuAPI
pub struct AnimationController {
    pub options AnimationOptions
    pub stamp time.Instant
}

Purpose

Structure encapsulating options, stamp.

Public fields

options AnimationOptions
field (AnimationOptions)
stamp time.Instant
field (time.Instant)

animation_controller

XuAPI
pub fn animation_controller(options &AnimationOptions) AnimationController

Purpose

Animation controller. Throws on failure; handle the error or propagate it to the caller.

Parameters

options &AnimationOptions
options (read-only borrow; caller keeps the original; type &AnimationOptions)

Returns

AnimationController — a value of this type

(&AnimationController) state

XuAPI
pub fn (a &AnimationController) state() int

Purpose

Execute state on &AnimationController.

Parameters

a &AnimationController
The AnimationController instance used by this call (borrow).

Returns

int — a value of this type

(&AnimationController) is_running

XuAPI
pub fn (a &AnimationController) is_running() bool

Purpose

Operation on &AnimationController: whether it is running.

Parameters

a &AnimationController
The AnimationController instance used by this call (borrow).

Returns

bool — true or false

(&AnimationController) progress

XuAPI
pub fn (a &AnimationController) progress() f64

Purpose

Execute progress on &AnimationController.

Parameters

a &AnimationController
The AnimationController instance used by this call (borrow).

Returns

f64 — a value of this type

(&AnimationController) value

XuAPI
pub fn (a &AnimationController) value() f64

Purpose

Execute value on &AnimationController.

Parameters

a &AnimationController
The AnimationController instance used by this call (borrow).

Returns

f64 — a value of this type

($&AnimationController) play

XuAPI
pub fn (a $&AnimationController) play(now time.Instant,reduced_motion bool) int

Purpose

Execute play on $&AnimationController.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

int — a value of this type

($&AnimationController) finish

XuAPI
pub fn (a $&AnimationController) finish()

Purpose

Execute finish on $&AnimationController.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&AnimationController) cancel

XuAPI
pub fn (a $&AnimationController) cancel()

Purpose

Execute cancel on $&AnimationController.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&AnimationController) advance

XuAPI
pub fn (a $&AnimationController) advance(now time.Instant,reduced_motion bool) bool

Purpose

Execute advance on $&AnimationController.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

($&AnimationController) pause

XuAPI
pub fn (a $&AnimationController) pause(now time.Instant) int

Purpose

Execute pause on $&AnimationController. Throws on failure; handle the error or propagate it to the caller.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

int — a value of this type

($&AnimationController) resume

XuAPI
pub fn (a $&AnimationController) resume(now time.Instant)

Purpose

Execute resume on $&AnimationController.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

This call does not return a value.

($&AnimationController) reverse

XuAPI
pub fn (a $&AnimationController) reverse(now time.Instant) int

Purpose

Operation on $&AnimationController: reverse. Throws on failure; handle the error or propagate it to the caller.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

int — a value of this type

($&AnimationController) seek

XuAPI
pub fn (a $&AnimationController) seek(progress f64,now time.Instant) int

Purpose

Operation on $&AnimationController: move the read position. whence 0/1/2 = absolute / relative / from end. Throws on failure; handle the error or propagate it to the caller.

Parameters

a $&AnimationController
The AnimationController instance used by this call (exclusive borrow).
progress f64
progress (f64)
now time.Instant
now (time.Instant)

Returns

int — a value of this type

(&AnimationController) next_tick

XuAPI
pub fn (a &AnimationController) next_tick(now time.Instant) time.Instant

Purpose

Operation on &AnimationController: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

a &AnimationController
The AnimationController instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

motion_ease

XuAPI
pub fn motion_ease(curve int,fraction f64) f64

Purpose

Shared by widget tweens, data transitions and application-owned timelines.

Parameters

curve int
curve (int)
fraction f64
fraction (f64)

Returns

f64 — a value of this type

motion_lerp

XuAPI
pub fn motion_lerp(from f64,to f64,progress f64) f64

Purpose

Motion lerp.

Parameters

from f64
from (f64)
to f64
to (f64)
progress f64
progress (f64)

Returns

f64 — a value of this type

const BUTTON_PRIMARY

XuAPI
pub const BUTTON_PRIMARY = 0

Purpose

Constant BUTTON_PRIMARY, defining protocol or algorithm parameters.

See usage example

const BUTTON_SECONDARY

XuAPI
pub const BUTTON_SECONDARY = 1

Purpose

Constant BUTTON_SECONDARY, defining protocol or algorithm parameters.

const BUTTON_OUTLINE

XuAPI
pub const BUTTON_OUTLINE = 2

Purpose

Constant BUTTON_OUTLINE, defining protocol or algorithm parameters.

See usage example

const BUTTON_GHOST

XuAPI
pub const BUTTON_GHOST = 3

Purpose

Constant BUTTON_GHOST, defining protocol or algorithm parameters.

const BUTTON_DANGER

XuAPI
pub const BUTTON_DANGER = 4

Purpose

Constant BUTTON_DANGER, defining protocol or algorithm parameters.

const BUTTON_SUBTLE

XuAPI
pub const BUTTON_SUBTLE = 5

Purpose

Constant BUTTON_SUBTLE, defining protocol or algorithm parameters.

See usage example

(&Styles) button_variant

XuAPI
pub fn (styles &Styles) button_variant(variant int) ControlStyle

Purpose

Appearance helpers return independent values. They preserve the existing Styles/ControlStyle wire format and all three levels of theme inheritance. Throws on failure; handle the error or propagate it to the caller.

Parameters

styles &Styles
The Styles instance used by this call (borrow).
variant int
variant (int)

Returns

ControlStyle — a value of this type

(&Styles) tree_style

XuAPI
pub fn (styles &Styles) tree_style() ControlStyle

Purpose

Operation on &Styles: tree style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) table_style

XuAPI
pub fn (styles &Styles) table_style() ControlStyle

Purpose

Operation on &Styles: table style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) overlay_style

XuAPI
pub fn (styles &Styles) overlay_style() ControlStyle

Purpose

Operation on &Styles: overlay style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) overlay_scrim

XuAPI
pub fn (styles &Styles) overlay_scrim() draw.Color

Purpose

Modal backdrop scrim color matched to Paper/Obsidian overlay tokens.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

draw.Color — a value of this type

const TREE_ICON_NONE

XuAPI
pub const TREE_ICON_NONE = 0

Purpose

Constant TREE_ICON_NONE, defining protocol or algorithm parameters.

const TREE_ICON_AUTO

XuAPI
pub const TREE_ICON_AUTO = 1

Purpose

Constant TREE_ICON_AUTO, defining protocol or algorithm parameters.

const TREE_ICON_FOLDER

XuAPI
pub const TREE_ICON_FOLDER = 2

Purpose

Constant TREE_ICON_FOLDER, defining protocol or algorithm parameters.

const TREE_ICON_FILE

XuAPI
pub const TREE_ICON_FILE = 3

Purpose

Constant TREE_ICON_FILE, defining protocol or algorithm parameters.

See usage example

struct TreeAppearance

XuAPI
pub struct TreeAppearance {
    pub indent f64
    pub row_height f64
    pub guides bool
    pub icons bool
    pub selection_mark bool
    pub guide_opacity f64
    pub action_width f64
}

Purpose

Structure encapsulating indent, row_height, guides, icons, selection_mark.

Public fields

indent f64
field (f64)
row_height f64
field (f64)
guides bool
field (bool)
icons bool
field (bool)
selection_mark bool
field (bool)
guide_opacity f64
field (f64)
action_width f64
field (f64)

tree_appearance

XuAPI
pub fn tree_appearance() TreeAppearance

Purpose

Tree appearance.

Parameters

No arguments are required.

Returns

TreeAppearance — a value of this type

See usage example

(&TreeAppearance) validate

XuAPI
pub fn (a &TreeAppearance) validate() int

Purpose

Execute validate on &TreeAppearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

a &TreeAppearance
The TreeAppearance instance used by this call (borrow).

Returns

int — a value of this type

const BADGE_NEUTRAL

XuAPI
pub const BADGE_NEUTRAL = 0

Purpose

Constant BADGE_NEUTRAL, defining protocol or algorithm parameters.

const BADGE_INFO

XuAPI
pub const BADGE_INFO = 1

Purpose

Constant BADGE_INFO, defining protocol or algorithm parameters.

See usage example

const BADGE_SUCCESS

XuAPI
pub const BADGE_SUCCESS = 2

Purpose

Constant BADGE_SUCCESS, defining protocol or algorithm parameters.

See usage example

const BADGE_WARNING

XuAPI
pub const BADGE_WARNING = 3

Purpose

Constant BADGE_WARNING, defining protocol or algorithm parameters.

const BADGE_ERROR

XuAPI
pub const BADGE_ERROR = 4

Purpose

Constant BADGE_ERROR, defining protocol or algorithm parameters.

See usage example

(&Styles) badge_variant

XuAPI
pub fn (styles &Styles) badge_variant(tone int) ControlStyle

Purpose

Operation on &Styles: badge variant.

Parameters

styles &Styles
The Styles instance used by this call (borrow).
tone int
tone (int)

Returns

ControlStyle — a value of this type

const BADGE_STATUS

XuAPI
pub const BADGE_STATUS = 0

Purpose

Constant BADGE_STATUS, defining protocol or algorithm parameters.

const BADGE_COUNT

XuAPI
pub const BADGE_COUNT = 1

Purpose

Constant BADGE_COUNT, defining protocol or algorithm parameters.

See usage example

const BADGE_DOT

XuAPI
pub const BADGE_DOT = 2

Purpose

Constant BADGE_DOT, defining protocol or algorithm parameters.

See usage example

(&Badge) variant

XuAPI
pub fn (badge &Badge) variant() int

Purpose

Execute variant on &Badge.

Parameters

badge &Badge
The Badge instance used by this call (borrow).

Returns

int — a value of this type

($&Badge) set_variant

XuAPI
pub fn (badge $&Badge) set_variant(variant int) int

Purpose

Operation on $&Badge: set variant. Throws on failure; handle the error or propagate it to the caller.

Parameters

badge $&Badge
The Badge instance used by this call (exclusive borrow).
variant int
variant (int)

Returns

int — a value of this type

($&Screen) badge_on

XuAPI
pub fn (s $&Screen) badge_on(anchor int,text string,variant int) int

Purpose

A passive adornment follows its anchor's bounds, scale, visibility and scroll. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
anchor int
anchor (int)
text string
text (string)
variant int
variant (int)

Returns

int — a value of this type

($&Screen) set_badge_variant

XuAPI
pub fn (s $&Screen) set_badge_variant(id int,variant int) int

Purpose

Operation on $&Screen: set badge variant. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
variant int
variant (int)

Returns

int — a value of this type

($&Screen) set_badge_anchor

XuAPI
pub fn (s $&Screen) set_badge_anchor(id int,anchor int,x f64,y f64) int

Purpose

Operation on $&Screen: set badge anchor. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
anchor int
anchor (int)
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&Screen) badge_size

XuAPI
pub fn (s $&Screen) badge_size(id int) layout.Size

Purpose

Operation on $&Screen: badge size. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

layout.Size — a value of this type

(&Breadcrumbs) overflow_bounds

XuAPI
pub fn (crumbs &Breadcrumbs) overflow_bounds() layout.Rect

Purpose

Operation on &Breadcrumbs: overflow bounds.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Breadcrumbs) popup_bounds

XuAPI
pub fn (crumbs &Breadcrumbs) popup_bounds() layout.Rect

Purpose

Operation on &Breadcrumbs: popup bounds.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Breadcrumbs) set_popup_above

XuAPI
pub fn (crumbs $&Breadcrumbs) set_popup_above(above bool)

Purpose

Operation on $&Breadcrumbs: set popup above.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
above bool
above (bool)

Returns

This call does not return a value.

($&Breadcrumbs) paint_popup_styled

XuAPI
pub fn (crumbs $&Breadcrumbs) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Breadcrumbs: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Breadcrumbs

XuAPI
pub struct Breadcrumbs {

}

Purpose

The last item is the current location; earlier items activate navigation. Long paths are clipped consistently with hit testing, not silently wrapped.

Public fields

This type has no public fields.

(&Breadcrumbs) id

XuAPI
pub fn (crumbs &Breadcrumbs) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

int — a value of this type

(&Breadcrumbs) bounds

XuAPI
pub fn (crumbs &Breadcrumbs) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Breadcrumbs) count

XuAPI
pub fn (crumbs &Breadcrumbs) count() int

Purpose

Return the number of items in this control.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

int — a value of this type

(&Breadcrumbs) is_selectable

XuAPI
pub fn (crumbs &Breadcrumbs) is_selectable() bool

Purpose

Operation on &Breadcrumbs: whether it is selectable.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

bool — true or false

($&Breadcrumbs) set_selectable

XuAPI
pub fn (crumbs $&Breadcrumbs) set_selectable(selectable bool)

Purpose

Operation on $&Breadcrumbs: set selectable.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Breadcrumbs) needs_paint

XuAPI
pub fn (crumbs &Breadcrumbs) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

bool — true or false

(&Breadcrumbs) visual_state

XuAPI
pub fn (crumbs &Breadcrumbs) visual_state() int

Purpose

Operation on &Breadcrumbs: visual state.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).

Returns

int — a value of this type

(&Breadcrumbs) style_or

XuAPI
pub fn (crumbs &Breadcrumbs) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Breadcrumbs: style or.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Breadcrumbs) set_style

XuAPI
pub fn (crumbs $&Breadcrumbs) set_style(style &ControlStyle) int

Purpose

Operation on $&Breadcrumbs: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Breadcrumbs) set_enabled

XuAPI
pub fn (crumbs $&Breadcrumbs) set_enabled(enabled bool)

Purpose

Operation on $&Breadcrumbs: set enabled.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Breadcrumbs) set_read_only

XuAPI
pub fn (crumbs $&Breadcrumbs) set_read_only(read_only bool) int

Purpose

Operation on $&Breadcrumbs: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&Breadcrumbs) set_bounds

XuAPI
pub fn (crumbs $&Breadcrumbs) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Breadcrumbs: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Breadcrumbs) set_focus

XuAPI
pub fn (crumbs $&Breadcrumbs) set_focus(focused bool)

Purpose

Operation on $&Breadcrumbs: set focus.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Breadcrumbs) set_text

XuAPI
pub fn (crumbs $&Breadcrumbs) set_text(index int,text &string) int

Purpose

Operation on $&Breadcrumbs: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
index int
index (int)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&Breadcrumbs) apply_styles

XuAPI
pub fn (crumbs $&Breadcrumbs) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Breadcrumbs) measure_styled

XuAPI
pub fn (crumbs $&Breadcrumbs) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&Breadcrumbs: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Breadcrumbs) item_bounds

XuAPI
pub fn (crumbs &Breadcrumbs) item_bounds(index int) layout.Rect

Purpose

Operation on &Breadcrumbs: item bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

(&Breadcrumbs) cursor_at

XuAPI
pub fn (crumbs &Breadcrumbs) cursor_at(x f64,y f64) int

Purpose

Operation on &Breadcrumbs: cursor at. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs &Breadcrumbs
The Breadcrumbs instance used by this call (borrow).
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&Breadcrumbs) input

XuAPI
pub fn (crumbs $&Breadcrumbs) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Breadcrumbs) route

XuAPI
pub fn (crumbs $&Breadcrumbs) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Breadcrumbs) paint_styled

XuAPI
pub fn (crumbs $&Breadcrumbs) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Breadcrumbs: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Breadcrumbs) dispose

XuAPI
pub fn (crumbs $&Breadcrumbs) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

crumbs $&Breadcrumbs
The Breadcrumbs instance used by this call (exclusive borrow).

Returns

This call does not return a value.

const BUTTON_GROUP_ACTIONS

XuAPI
pub const BUTTON_GROUP_ACTIONS = 0

Purpose

Constant BUTTON_GROUP_ACTIONS, defining protocol or algorithm parameters.

See usage example

const BUTTON_GROUP_SINGLE

XuAPI
pub const BUTTON_GROUP_SINGLE = 1

Purpose

Constant BUTTON_GROUP_SINGLE, defining protocol or algorithm parameters.

See usage example

const BUTTON_GROUP_MULTIPLE

XuAPI
pub const BUTTON_GROUP_MULTIPLE = 2

Purpose

Constant BUTTON_GROUP_MULTIPLE, defining protocol or algorithm parameters.

See usage example

struct ButtonGroupItem

XuAPI
pub struct ButtonGroupItem {
    pub key int
    pub label string
    pub enabled bool
    pub selected bool
    pub variant int
}

Purpose

Structure encapsulating key, label, enabled, selected, variant.

Public fields

key int
key
label string
field (string)
enabled bool
field (bool)
selected bool
field (bool)
variant int
field (int)

button_group_item

XuAPI
pub fn button_group_item(key int,label string) ButtonGroupItem

Purpose

Button group item.

Parameters

key int
key (int)
label string
label (string)

Returns

ButtonGroupItem — a value of this type

See usage example

struct ButtonGroupAppearance

XuAPI
pub struct ButtonGroupAppearance {
    pub vertical bool
    pub joined bool
    pub equal_width bool
    pub allow_empty bool
    pub gap f64
    pub min_item_width f64
}

Purpose

Structure encapsulating vertical, joined, equal_width, allow_empty, gap.

Public fields

vertical bool
field (bool)
joined bool
field (bool)
equal_width bool
field (bool)
allow_empty bool
field (bool)
gap f64
field (f64)
min_item_width f64
field (f64)

button_group_appearance

XuAPI
pub fn button_group_appearance() ButtonGroupAppearance

Purpose

Button group appearance.

Parameters

No arguments are required.

Returns

ButtonGroupAppearance — a value of this type

See usage example

(&ButtonGroupAppearance) validate

XuAPI
pub fn (a &ButtonGroupAppearance) validate() int

Purpose

Execute validate on &ButtonGroupAppearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

a &ButtonGroupAppearance
The ButtonGroupAppearance instance used by this call (borrow).

Returns

int — a value of this type

struct ButtonGroup

XuAPI
pub struct ButtonGroup {

}

Purpose

ButtonGroup context or state structure.

Public fields

This type has no public fields.

button_group

XuAPI
pub fn button_group(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,items &[]ButtonGroupItem,mode int) ButtonGroup

Purpose

Button group. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
items &[]ButtonGroupItem
items (read-only borrow; caller keeps the original; type &[]ButtonGroupItem)
mode int
mode (int)

Returns

ButtonGroup — a value of this type

(&ButtonGroup) id

XuAPI
pub fn (g &ButtonGroup) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

int — a value of this type

(&ButtonGroup) bounds

XuAPI
pub fn (g &ButtonGroup) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ButtonGroup) needs_paint

XuAPI
pub fn (g &ButtonGroup) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

bool — true or false

($&ButtonGroup) painted

XuAPI
pub fn (g $&ButtonGroup) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&ButtonGroup) is_enabled

XuAPI
pub fn (g &ButtonGroup) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

bool — true or false

(&ButtonGroup) is_selectable

XuAPI
pub fn (g &ButtonGroup) is_selectable() bool

Purpose

Operation on &ButtonGroup: whether it is selectable.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

bool — true or false

($&ButtonGroup) set_selectable

XuAPI
pub fn (g $&ButtonGroup) set_selectable(selectable bool)

Purpose

Operation on $&ButtonGroup: set selectable.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&ButtonGroup) is_focused

XuAPI
pub fn (g &ButtonGroup) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

bool — true or false

(&ButtonGroup) active_key

XuAPI
pub fn (g &ButtonGroup) active_key() int

Purpose

Operation on &ButtonGroup: active key.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

int — a value of this type

(&ButtonGroup) values

XuAPI
pub fn (g &ButtonGroup) values() []int

Purpose

Return a slice containing all values in the collection.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).

Returns

[]int — slice result

($&ButtonGroup) set_items

XuAPI
pub fn (g $&ButtonGroup) set_items(items &[]ButtonGroupItem) int

Purpose

Operation on $&ButtonGroup: set items. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
items &[]ButtonGroupItem
items (read-only borrow; caller keeps the original; type &[]ButtonGroupItem)

Returns

int — a value of this type

($&ButtonGroup) set_appearance

XuAPI
pub fn (g $&ButtonGroup) set_appearance(a &ButtonGroupAppearance) int

Purpose

Operation on $&ButtonGroup: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
a &ButtonGroupAppearance
value (read-only borrow; caller keeps the original; type &ButtonGroupAppearance)

Returns

int — a value of this type

($&ButtonGroup) set_item_enabled

XuAPI
pub fn (g $&ButtonGroup) set_item_enabled(key int,enabled bool) int

Purpose

Operation on $&ButtonGroup: set item enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
key int
key (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&ButtonGroup) set_item_label

XuAPI
pub fn (g $&ButtonGroup) set_item_label(key int,label string) int

Purpose

Operation on $&ButtonGroup: set item label. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
key int
key (int)
label string
label (string)

Returns

int — a value of this type

($&ButtonGroup) set_checked

XuAPI
pub fn (g $&ButtonGroup) set_checked(key int,selected bool) int

Purpose

Operation on $&ButtonGroup: set checked. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
key int
key (int)
selected bool
selected (bool)

Returns

int — a value of this type

($&ButtonGroup) set_focus

XuAPI
pub fn (g $&ButtonGroup) set_focus(value bool)

Purpose

Operation on $&ButtonGroup: set focus.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&ButtonGroup) cancel

XuAPI
pub fn (g $&ButtonGroup) cancel()

Purpose

Execute cancel on $&ButtonGroup.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ButtonGroup) set_enabled

XuAPI
pub fn (g $&ButtonGroup) set_enabled(value bool)

Purpose

Operation on $&ButtonGroup: set enabled.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&ButtonGroup) set_read_only

XuAPI
pub fn (g $&ButtonGroup) set_read_only(value bool)

Purpose

Operation on $&ButtonGroup: set read only.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&ButtonGroup) set_bounds

XuAPI
pub fn (g $&ButtonGroup) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&ButtonGroup: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&ButtonGroup) set_style

XuAPI
pub fn (g $&ButtonGroup) set_style(style &ControlStyle) int

Purpose

Operation on $&ButtonGroup: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&ButtonGroup) clear_style

XuAPI
pub fn (g $&ButtonGroup) clear_style()

Purpose

Operation on $&ButtonGroup: clear style.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ButtonGroup) set_motion

XuAPI
pub fn (g $&ButtonGroup) set_motion(spec &MotionSpec) int

Purpose

Operation on $&ButtonGroup: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&ButtonGroup) apply_styles

XuAPI
pub fn (g $&ButtonGroup) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&ButtonGroup) item_bounds

XuAPI
pub fn (g &ButtonGroup) item_bounds(key int) layout.Rect

Purpose

Operation on &ButtonGroup: item bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).
key int
key (int)

Returns

layout.Rect — a value of this type

($&ButtonGroup) input

XuAPI
pub fn (g $&ButtonGroup) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ButtonGroup) route

XuAPI
pub fn (g $&ButtonGroup) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ButtonGroup) tick

XuAPI
pub fn (g $&ButtonGroup) tick(styles &Styles,now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&ButtonGroup) next_tick

XuAPI
pub fn (g &ButtonGroup) next_tick(now time.Instant) time.Instant

Purpose

Operation on &ButtonGroup: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

g &ButtonGroup
The ButtonGroup instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&ButtonGroup) paint_styled

XuAPI
pub fn (g $&ButtonGroup) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&ButtonGroup: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&ButtonGroup) dispose

XuAPI
pub fn (g $&ButtonGroup) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

g $&ButtonGroup
The ButtonGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Button) measure_icon_styled

XuAPI
pub fn (button &Button) measure_icon_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Measure the icon, label, gap and padding. icon_size=0 removes icon spacing.

Parameters

button &Button
The Button instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

intrinsic logical size

(&Button) paint_icon_styled

XuAPI
pub fn (button &Button) paint_icon_styled(frame $&draw.Frame,label $&StyledLabel,image &draw.Image,styles &Styles) int

Purpose

Paint an image icon and label using styles. The icon preserves aspect ratio; the caller owns the Image.

Parameters

button &Button
The Button instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
image &draw.Image
image (read-only borrow; caller keeps the original; type &draw.Image)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

struct CardRegions

XuAPI
pub struct CardRegions {
    pub header layout.Rect
    pub body layout.Rect
    pub footer layout.Rect
}

Purpose

Structure encapsulating header, body, footer.

Public fields

header layout.Rect
field (layout.Rect)
body layout.Rect
body
footer layout.Rect
field (layout.Rect)

(&Card) regions

XuAPI
pub fn (card &Card) regions(styles &Styles,header_height f64,footer_height f64) CardRegions

Purpose

Execute regions on &Card. Throws on failure; handle the error or propagate it to the caller.

Parameters

card &Card
The Card instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
header_height f64
header_height (f64)
footer_height f64
footer_height (f64)

Returns

CardRegions — a value of this type

struct CardSections

XuAPI
pub struct CardSections {
    pub header int
    pub body int
    pub footer int
}

Purpose

Structure encapsulating header, body, footer.

Public fields

header int
field (int)
body int
body
footer int
field (int)

($&Screen) card_sections

XuAPI
pub fn (s $&Screen) card_sections(id int,header_height f64,footer_height f64) CardSections

Purpose

Operation on $&Screen: card sections. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
header_height f64
header_height (f64)
footer_height f64
footer_height (f64)

Returns

CardSections — a value of this type

badge_count_text

XuAPI
pub fn badge_count_text(count int,maximum int) string

Purpose

Counts remain separate from tone; zero can hide an optional numeric badge. Throws on failure; handle the error or propagate it to the caller.

Parameters

count int
count (int)
maximum int
maximum (int)

Returns

string — result string

($&Screen) set_badge_count

XuAPI
pub fn (s $&Screen) set_badge_count(id int,count int,maximum int,show_zero bool) int

Purpose

Operation on $&Screen: set badge count. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
count int
count (int)
maximum int
maximum (int)
show_zero bool
show_zero (bool)

Returns

int — a value of this type

(&Locale) badge_count

XuAPI
pub fn (locale &Locale) badge_count(count int,maximum int) string

Purpose

Operation on &Locale: badge count. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
count int
count (int)
maximum int
maximum (int)

Returns

string — result string

struct ColorPicker

XuAPI
pub struct ColorPicker {

}

Purpose

Inline RGBA picker: four quantized 0..255 channels and a checkerboard alpha preview. Up/Down selects a channel; Left/Right, Home/End and Page keys adjust it. Each channel is also a draggable Slider. This is deliberately a small RGB editor rather than an HSV spectrum, OS eyedropper or color-profile tool.

Public fields

This type has no public fields.

color_picker

XuAPI
pub fn color_picker(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value draw.Color) ColorPicker

Purpose

Color picker. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value draw.Color
value (draw.Color)

Returns

ColorPicker — a value of this type

(&ColorPicker) id

XuAPI
pub fn (picker &ColorPicker) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

int — a value of this type

(&ColorPicker) bounds

XuAPI
pub fn (picker &ColorPicker) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ColorPicker) is_enabled

XuAPI
pub fn (picker &ColorPicker) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

bool — true or false

(&ColorPicker) is_selectable

XuAPI
pub fn (picker &ColorPicker) is_selectable() bool

Purpose

Operation on &ColorPicker: whether it is selectable.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

bool — true or false

($&ColorPicker) set_selectable

XuAPI
pub fn (picker $&ColorPicker) set_selectable(selectable bool)

Purpose

Operation on $&ColorPicker: set selectable.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&ColorPicker) is_focused

XuAPI
pub fn (picker &ColorPicker) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

bool — true or false

(&ColorPicker) active_channel

XuAPI
pub fn (picker &ColorPicker) active_channel() int

Purpose

Operation on &ColorPicker: active channel.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

int — a value of this type

(&ColorPicker) needs_paint

XuAPI
pub fn (picker &ColorPicker) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

bool — true or false

(&ColorPicker) channel

XuAPI
pub fn (picker &ColorPicker) channel(index int) int

Purpose

Execute channel on &ColorPicker. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).
index int
index (int)

Returns

int — a value of this type

(&ColorPicker) value

XuAPI
pub fn (picker &ColorPicker) value() draw.Color

Purpose

Read the color assembled from the four current channels for painting or storage.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

A draw.Color with red, green, blue and alpha.

($&ColorPicker) set_channel

XuAPI
pub fn (picker $&ColorPicker) set_channel(index int,value int) int

Purpose

Update one RGBA channel, for example from a numeric field.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
index int
Channel: 0 red, 1 green, 2 blue, 3 alpha.
value int
Channel intensity 0..255; alpha 0 is transparent and 255 is opaque.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Error handling

  • A disposed control, invalid channel or out-of-range value throws instead of silently clamping.

($&ColorPicker) set_value

XuAPI
pub fn (picker $&ColorPicker) set_value(value draw.Color) int

Purpose

Set an RGBA color and synchronize all four channel sliders.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
value draw.Color
Complete draw.Color, including alpha.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Error handling

  • A channel update failure propagates.

(&ColorPicker) style_or

XuAPI
pub fn (picker &ColorPicker) style_or(styles &Styles) ControlStyle

Purpose

Operation on &ColorPicker: style or.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&ColorPicker) set_style

XuAPI
pub fn (picker $&ColorPicker) set_style(style &ControlStyle) int

Purpose

Operation on $&ColorPicker: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&ColorPicker) set_enabled

XuAPI
pub fn (picker $&ColorPicker) set_enabled(enabled bool)

Purpose

Operation on $&ColorPicker: set enabled.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&ColorPicker) set_read_only

XuAPI
pub fn (picker $&ColorPicker) set_read_only(read_only bool) int

Purpose

Operation on $&ColorPicker: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&ColorPicker) set_invalid

XuAPI
pub fn (picker $&ColorPicker) set_invalid(invalid bool)

Purpose

Operation on $&ColorPicker: set invalid.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&ColorPicker) set_focus

XuAPI
pub fn (picker $&ColorPicker) set_focus(focused bool)

Purpose

Operation on $&ColorPicker: set focus.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&ColorPicker) preview_bounds

XuAPI
pub fn (picker &ColorPicker) preview_bounds() layout.Rect

Purpose

Operation on &ColorPicker: preview bounds.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ColorPicker) channel_bounds

XuAPI
pub fn (picker &ColorPicker) channel_bounds(index int) layout.Rect

Purpose

Operation on &ColorPicker: channel bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

($&ColorPicker) set_bounds

XuAPI
pub fn (picker $&ColorPicker) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&ColorPicker: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&ColorPicker) apply_styles

XuAPI
pub fn (picker $&ColorPicker) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&ColorPicker) input

XuAPI
pub fn (picker $&ColorPicker) input(event &ui.InputEvent) Action

Purpose

Route input to the active RGBA channel and report color changes or commits.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
event &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • While focused, Up/Down switches channels; Action.value contains the packed color number, and value() returns a draw.Color.

($&ColorPicker) route

XuAPI
pub fn (picker $&ColorPicker) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ColorPicker) event

XuAPI
pub fn (picker $&ColorPicker) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ColorPicker) measure_styled

XuAPI
pub fn (picker $&ColorPicker) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&ColorPicker: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&ColorPicker) paint_styled

XuAPI
pub fn (picker $&ColorPicker) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&ColorPicker: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&ColorPicker) dispose

XuAPI
pub fn (picker $&ColorPicker) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&ColorPicker) hex

XuAPI
pub fn (picker &ColorPicker) hex() string

Purpose

Execute hex on &ColorPicker.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

string — result string

($&ColorPicker) set_hex

XuAPI
pub fn (picker $&ColorPicker) set_hex(text &string) int

Purpose

Operation on $&ColorPicker: set hex. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&ColorPicker) set_swatches

XuAPI
pub fn (picker $&ColorPicker) set_swatches(colors &[]draw.Color) int

Purpose

Operation on $&ColorPicker: set swatches. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
colors &[]draw.Color
colors (read-only borrow; caller keeps the original; type &[]draw.Color)

Returns

int — a value of this type

($&ColorPicker) remember

XuAPI
pub fn (picker $&ColorPicker) remember()

Purpose

Execute remember on $&ColorPicker.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&ColorPicker) recent_colors

XuAPI
pub fn (picker &ColorPicker) recent_colors() []draw.Color

Purpose

Operation on &ColorPicker: recent colors.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).

Returns

[]draw.Color — slice result

(&ColorPicker) swatch_bounds

XuAPI
pub fn (picker &ColorPicker) swatch_bounds(index int) layout.Rect

Purpose

Operation on &ColorPicker: swatch bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &ColorPicker
The ColorPicker instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

($&ColorPicker) set_show_swatches

XuAPI
pub fn (picker $&ColorPicker) set_show_swatches(visible bool)

Purpose

Operation on $&ColorPicker: set show swatches.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
visible bool
visible (bool)

Returns

This call does not return a value.

struct ComboBox

XuAPI
pub struct ComboBox {

}

Purpose

Editable choice field. Text is owned by Editor and travels through the native TextInput revision/IME protocol, including composition, clipboard and Unicode. Call event for native events and place_combo_box after each View layout. route receives node-local input; input receives canvas coordinates, which lets the scene intercept an open popup before dispatching an outside press. paint_styled paints locally like Editor; paint_popup_styled is canvas-space.

Public fields

This type has no public fields.

combo_box

XuAPI
pub fn combo_box(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,options &[]string,value &string) ComboBox

Purpose

Combo box. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

ComboBox — a value of this type

(&ComboBox) id

XuAPI
pub fn (combo &ComboBox) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

int — a value of this type

(&ComboBox) bounds

XuAPI
pub fn (combo &ComboBox) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ComboBox) value

XuAPI
pub fn (combo &ComboBox) value() string

Purpose

Execute value on &ComboBox.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

string — result string

(&ComboBox) selected_text

XuAPI
pub fn (combo &ComboBox) selected_text() string

Purpose

Operation on &ComboBox: selected text.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

string — result string

(&ComboBox) selected

XuAPI
pub fn (combo &ComboBox) selected() int

Purpose

Read the original option index matching the current text, to check whether it corresponds to an existing choice.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

Original matching option index, or -1 when the text matches no option.

(&ComboBox) count

XuAPI
pub fn (combo &ComboBox) count() int

Purpose

Return the number of items in this control.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

int — a value of this type

(&ComboBox) filtered_count

XuAPI
pub fn (combo &ComboBox) filtered_count() int

Purpose

Operation on &ComboBox: filtered count.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

int — a value of this type

(&ComboBox) is_open

XuAPI
pub fn (combo &ComboBox) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

(&ComboBox) has_popup_open

XuAPI
pub fn (combo &ComboBox) has_popup_open() bool

Purpose

Operation on &ComboBox: whether it has popup open.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

(&ComboBox) is_selectable

XuAPI
pub fn (combo &ComboBox) is_selectable() bool

Purpose

Operation on &ComboBox: whether it is selectable.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

(&ComboBox) is_focused

XuAPI
pub fn (combo &ComboBox) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

(&ComboBox) is_enabled

XuAPI
pub fn (combo &ComboBox) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

(&ComboBox) needs_paint

XuAPI
pub fn (combo &ComboBox) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

($&ComboBox) set_placeholder

XuAPI
pub fn (combo $&ComboBox) set_placeholder(value &string) int

Purpose

Operation on $&ComboBox: set placeholder. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

(&ComboBox) style_or

XuAPI
pub fn (combo &ComboBox) style_or(styles &Styles) ControlStyle

Purpose

Operation on &ComboBox: style or.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&ComboBox) set_style

XuAPI
pub fn (combo $&ComboBox) set_style(style &ControlStyle) int

Purpose

Operation on $&ComboBox: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&ComboBox) set_enabled

XuAPI
pub fn (combo $&ComboBox) set_enabled(enabled bool) int

Purpose

Operation on $&ComboBox: set enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

($&ComboBox) set_read_only

XuAPI
pub fn (combo $&ComboBox) set_read_only(read_only bool) int

Purpose

Operation on $&ComboBox: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&ComboBox) set_selectable

XuAPI
pub fn (combo $&ComboBox) set_selectable(selectable bool) int

Purpose

Operation on $&ComboBox: set selectable. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

int — a value of this type

($&ComboBox) set_viewport

XuAPI
pub fn (combo $&ComboBox) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&ComboBox: set viewport.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&ComboBox) set_invalid

XuAPI
pub fn (combo $&ComboBox) set_invalid(invalid bool)

Purpose

Operation on $&ComboBox: set invalid.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&ComboBox) focus_session

XuAPI
pub fn (combo $&ComboBox) focus_session(focused bool) int

Purpose

Operation on $&ComboBox: focus session. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

int — a value of this type

($&ComboBox) set_bounds

XuAPI
pub fn (combo $&ComboBox) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&ComboBox: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

place_combo_box

XuAPI
pub fn place_combo_box(view $&View,combo $&ComboBox) int

Purpose

Place combo box. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
combo $&ComboBox
combo (exclusive borrow; may modify the original; type $&ComboBox)

Returns

int — a value of this type

($&ComboBox) set_value

XuAPI
pub fn (combo $&ComboBox) set_value(value &string) int

Purpose

Programmatically replace editable combo-box text and refresh its query state.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
value &string
Complete new text; an exact option match updates the matching index.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Error handling

  • An editor replacement failure, such as active IME composition, propagates.

($&ComboBox) set_selected

XuAPI
pub fn (combo $&ComboBox) set_selected(index int) int

Purpose

Select an existing choice, copy its text into the editor and close the list.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
index int
Zero-based index in the original options, not the filtered visible row.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Error handling

  • An invalid index throws widgets: combo choice out of range; replacing text during IME composition can also throw.

($&ComboBox) set_open

XuAPI
pub fn (combo $&ComboBox) set_open(open bool)

Purpose

Set whether the option list is open.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
open bool
true requests opening and false closes it; disabled or read-only controls remain closed.

Returns

No return value; read the resulting state with is_open().

Usage notes

  • Opening and painting are separate: call paint_popup_styled in an appropriate overlay pass.
  • An explicit open shows all options; subsequent editing filters them.

($&ComboBox) set_popup_above

XuAPI
pub fn (combo $&ComboBox) set_popup_above(above bool)

Purpose

Operation on $&ComboBox: set popup above.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
above bool
above (bool)

Returns

This call does not return a value.

($&ComboBox) apply_styles

XuAPI
pub fn (combo $&ComboBox) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&ComboBox) popup_bounds

XuAPI
pub fn (combo &ComboBox) popup_bounds() layout.Rect

Purpose

Read the option-list rectangle in canvas coordinates for overlay hit testing or layout.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

The list's layout.Rect; reading it does not open the list, so also check is_open().

(&ComboBox) option_bounds

XuAPI
pub fn (combo &ComboBox) option_bounds(index int) layout.Rect

Purpose

Operation on &ComboBox: option bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

(&ComboBox) toggle_bounds

XuAPI
pub fn (combo &ComboBox) toggle_bounds() layout.Rect

Purpose

Operation on &ComboBox: toggle bounds.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&ComboBox) input

XuAPI
pub fn (combo $&ComboBox) input(event &ui.InputEvent) Action

Purpose

Process editable combo-box choice selection, its toggle and editor input.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
event &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • Choosing an item yields ACTION_CHANGE with its original option index in value; Enter and arrows remain with the editor during IME composition.

($&ComboBox) route

XuAPI
pub fn (combo $&ComboBox) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ComboBox) event

XuAPI
pub fn (combo $&ComboBox) event(event &ui.Event) Action

Purpose

Receive native window events, routing input to input and other events to the internal editor or base control.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
event &ui.Event
Full native ui.Event; use this entry point for IME, blur and lifecycle handling.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • The option list closes when its internal control loses focus.

($&ComboBox) tick

XuAPI
pub fn (combo $&ComboBox) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

(&ComboBox) next_caret_tick

XuAPI
pub fn (combo &ComboBox) next_caret_tick(now time.Instant,reduced_motion bool) time.Instant

Purpose

Operation on &ComboBox: next caret tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

time.Instant — a value of this type

($&ComboBox) measure_styled

XuAPI
pub fn (combo $&ComboBox) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&ComboBox: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&ComboBox) paint_styled

XuAPI
pub fn (combo $&ComboBox) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&ComboBox: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&ComboBox) paint_popup_styled

XuAPI
pub fn (combo $&ComboBox) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint the expanded option list separately from the field so it can appear above other controls.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
frame $&draw.Frame
Current frame to receive drawing commands.
styles &Styles
Effective styles supplying colors, spacing, fonts and state appearance.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • Paint in canvas coordinates, normally after regular controls. A field-local transform or clip can shift or cut off the list.

Error handling

  • Frame, text or style failures propagate as errors.

($&ComboBox) dispose

XuAPI
pub fn (combo $&ComboBox) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ComboBox) set_allow_custom

XuAPI
pub fn (combo $&ComboBox) set_allow_custom(allowed bool)

Purpose

Operation on $&ComboBox: set allow custom.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
allowed bool
allowed (bool)

Returns

This call does not return a value.

(&ComboBox) is_valid_choice

XuAPI
pub fn (combo &ComboBox) is_valid_choice() bool

Purpose

Operation on &ComboBox: whether it is valid choice.

Parameters

combo &ComboBox
The ComboBox instance used by this call (borrow).

Returns

bool — true or false

(&Button) clone

XuAPI
pub fn (b &Button) clone() Button

Purpose

Copy the control or style snapshot into an independent Button value.

Parameters

b &Button
The Button instance used by this call (borrow).

Returns

Button — a value of this type

(&Radio) clone

XuAPI
pub fn (r &Radio) clone() Radio

Purpose

Copy the control or style snapshot into an independent Radio value.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

Radio — a value of this type

(&Checkbox) clone

XuAPI
pub fn (c &Checkbox) clone() Checkbox

Purpose

Copy the control or style snapshot into an independent Checkbox value.

Parameters

c &Checkbox
The Checkbox instance used by this call (borrow).

Returns

Checkbox — a value of this type

(&Switch) clone

XuAPI
pub fn (value &Switch) clone() Switch

Purpose

Copy the control or style snapshot into an independent Switch value.

Parameters

value &Switch
The Switch instance used by this call (borrow).

Returns

Switch — a value of this type

(&Slider) clone

XuAPI
pub fn (value &Slider) clone() Slider

Purpose

Copy the control or style snapshot into an independent Slider value.

Parameters

value &Slider
The Slider instance used by this call (borrow).

Returns

Slider — a value of this type

(&Stepper) clone

XuAPI
pub fn (value &Stepper) clone() Stepper

Purpose

Copy the control or style snapshot into an independent Stepper value.

Parameters

value &Stepper
The Stepper instance used by this call (borrow).

Returns

Stepper — a value of this type

(&Tabs) clone

XuAPI
pub fn (value &Tabs) clone() Tabs

Purpose

Copy the control or style snapshot into an independent Tabs value.

Parameters

value &Tabs
The Tabs instance used by this call (borrow).

Returns

Tabs — a value of this type

(&Select) clone

XuAPI
pub fn (value &Select) clone() Select

Purpose

Copy the control or style snapshot into an independent Select value.

Parameters

value &Select
The Select instance used by this call (borrow).

Returns

Select — a value of this type

(&ListBox) clone

XuAPI
pub fn (value &ListBox) clone() ListBox

Purpose

Copy the control or style snapshot into an independent ListBox value.

Parameters

value &ListBox
The ListBox instance used by this call (borrow).

Returns

ListBox — a value of this type

(&Progress) clone

XuAPI
pub fn (value &Progress) clone() Progress

Purpose

Copy the control or style snapshot into an independent Progress value.

Parameters

value &Progress
The Progress instance used by this call (borrow).

Returns

Progress — a value of this type

(&Divider) clone

XuAPI
pub fn (value &Divider) clone() Divider

Purpose

Copy the control or style snapshot into an independent Divider value.

Parameters

value &Divider
The Divider instance used by this call (borrow).

Returns

Divider — a value of this type

(&Badge) clone

XuAPI
pub fn (value &Badge) clone() Badge

Purpose

Copy the control or style snapshot into an independent Badge value.

Parameters

value &Badge
The Badge instance used by this call (borrow).

Returns

Badge — a value of this type

(&Card) clone

XuAPI
pub fn (value &Card) clone() Card

Purpose

Copy the control or style snapshot into an independent Card value.

Parameters

value &Card
The Card instance used by this call (borrow).

Returns

Card — a value of this type

(&Scroll) clone

XuAPI
pub fn (value &Scroll) clone() Scroll

Purpose

Copy the control or style snapshot into an independent Scroll value.

Parameters

value &Scroll
The Scroll instance used by this call (borrow).

Returns

Scroll — a value of this type

($&DatePicker) set_locale

XuAPI
pub fn (picker $&DatePicker) set_locale(locale &Locale) int

Purpose

Operation on $&DatePicker: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&TimePicker) set_locale

XuAPI
pub fn (picker $&TimePicker) set_locale(locale &Locale) int

Purpose

Operation on $&TimePicker: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Table) set_locale

XuAPI
pub fn (table $&Table) set_locale(locale &Locale) int

Purpose

Operation on $&Table: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

table $&Table
The Table instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Pagination) set_locale

XuAPI
pub fn (page $&Pagination) set_locale(locale &Locale) int

Purpose

Operation on $&Pagination: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

page $&Pagination
The Pagination instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&ColorPicker) set_locale

XuAPI
pub fn (picker $&ColorPicker) set_locale(locale &Locale) int

Purpose

Operation on $&ColorPicker: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&ColorPicker
The ColorPicker instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Slider) set_locale

XuAPI
pub fn (slider $&Slider) set_locale(locale &Locale) int

Purpose

Operation on $&Slider: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

slider $&Slider
The Slider instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Stepper) set_locale

XuAPI
pub fn (stepper $&Stepper) set_locale(locale &Locale) int

Purpose

Operation on $&Stepper: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

stepper $&Stepper
The Stepper instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Field) set_locale

XuAPI
pub fn (field $&Field) set_locale(locale &Locale) int

Purpose

Operation on $&Field: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

field $&Field
The Field instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&TaskButton) set_locale

XuAPI
pub fn (task $&TaskButton) set_locale(locale &Locale) int

Purpose

Operation on $&TaskButton: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&TaskButton) use_locale_labels

XuAPI
pub fn (task $&TaskButton) use_locale_labels() int

Purpose

Operation on $&TaskButton: use locale labels. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).

Returns

int — a value of this type

(&TaskButton) label_text

XuAPI
pub fn (task &TaskButton) label_text() string

Purpose

Operation on &TaskButton: label text. Throws on failure; handle the error or propagate it to the caller.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

string — result string

($&MultiSelect) set_locale

XuAPI
pub fn (multi $&MultiSelect) set_locale(locale &Locale) int

Purpose

Operation on $&MultiSelect: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&ComboBox) set_locale

XuAPI
pub fn (combo $&ComboBox) set_locale(locale &Locale) int

Purpose

Operation on $&ComboBox: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

combo $&ComboBox
The ComboBox instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

(&MultiSelect) selection_text

XuAPI
pub fn (multi &MultiSelect) selection_text() string

Purpose

Operation on &MultiSelect: selection text. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

string — result string

(&Stepper) value_text

XuAPI
pub fn (stepper &Stepper) value_text() string

Purpose

Operation on &Stepper: value text. Throws on failure; handle the error or propagate it to the caller.

Parameters

stepper &Stepper
The Stepper instance used by this call (borrow).

Returns

string — result string

($&TimePicker) use_locale_clock

XuAPI
pub fn (picker $&TimePicker) use_locale_clock()

Purpose

Operation on $&TimePicker: use locale clock.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&DatePicker) display_text

XuAPI
pub fn (picker &DatePicker) display_text() string

Purpose

Operation on &DatePicker: display text. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

string — result string

struct Switch

XuAPI
pub struct Switch {

}

Purpose

Switch context or state structure.

Public fields

This type has no public fields.

See usage example

switch_control

XuAPI
pub fn switch_control(identity &ui.CanvasEvent,id int,bounds &layout.Rect,checked bool) Switch

Purpose

Switch control. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
checked bool
checked (bool)

Returns

Switch — a value of this type

See usage example

(&Switch) id

XuAPI
pub fn (sw &Switch) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

int — a value of this type

(&Switch) bounds

XuAPI
pub fn (sw &Switch) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Switch) needs_paint

XuAPI
pub fn (sw &Switch) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) painted

XuAPI
pub fn (sw $&Switch) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Switch) invalidate

XuAPI
pub fn (sw $&Switch) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Switch) cancel

XuAPI
pub fn (sw $&Switch) cancel()

Purpose

Execute cancel on $&Switch.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Switch) is_enabled

XuAPI
pub fn (sw &Switch) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

(&Switch) is_selectable

XuAPI
pub fn (sw &Switch) is_selectable() bool

Purpose

Operation on &Switch: whether it is selectable.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) set_selectable

XuAPI
pub fn (sw $&Switch) set_selectable(selectable bool)

Purpose

Operation on $&Switch: set selectable.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Switch) set_enabled

XuAPI
pub fn (sw $&Switch) set_enabled(enabled bool)

Purpose

Operation on $&Switch: set enabled.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Switch) is_focused

XuAPI
pub fn (sw &Switch) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) set_focus

XuAPI
pub fn (sw $&Switch) set_focus(focused bool)

Purpose

Operation on $&Switch: set focus.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Switch) is_hovered

XuAPI
pub fn (sw &Switch) is_hovered() bool

Purpose

Operation on &Switch: whether it is hovered.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

(&Switch) is_pressed

XuAPI
pub fn (sw &Switch) is_pressed() bool

Purpose

Operation on &Switch: whether it is pressed.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

(&Switch) is_invalid

XuAPI
pub fn (sw &Switch) is_invalid() bool

Purpose

Operation on &Switch: whether it is invalid.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) set_invalid

XuAPI
pub fn (sw $&Switch) set_invalid(invalid bool)

Purpose

Operation on $&Switch: set invalid.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Switch) is_read_only

XuAPI
pub fn (sw &Switch) is_read_only() bool

Purpose

Operation on &Switch: whether it is read only.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) set_read_only

XuAPI
pub fn (sw $&Switch) set_read_only(read_only bool)

Purpose

Operation on $&Switch: set read only.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&Switch) set_bounds

XuAPI
pub fn (sw $&Switch) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Switch: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Switch) value

XuAPI
pub fn (sw &Switch) value() bool

Purpose

Execute value on &Switch.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) set_value

XuAPI
pub fn (sw $&Switch) set_value(checked bool)

Purpose

Operation on $&Switch: set value.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
checked bool
checked (bool)

Returns

This call does not return a value.

(&Switch) visual_state

XuAPI
pub fn (sw &Switch) visual_state() int

Purpose

Operation on &Switch: visual state.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

int — a value of this type

(&Switch) has_style

XuAPI
pub fn (sw &Switch) has_style() bool

Purpose

Operation on &Switch: whether it has style.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

(&Switch) style_or

XuAPI
pub fn (sw &Switch) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Switch: style or.

Parameters

sw &Switch
The Switch instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Switch) set_style

XuAPI
pub fn (sw $&Switch) set_style(style &ControlStyle) int

Purpose

Operation on $&Switch: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Switch) clear_style

XuAPI
pub fn (sw $&Switch) clear_style()

Purpose

Operation on $&Switch: clear style.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Switch) input

XuAPI
pub fn (sw $&Switch) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Switch) event

XuAPI
pub fn (sw $&Switch) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Switch) paint

XuAPI
pub fn (sw &Switch) paint(frame $&draw.Frame,label &draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw &Switch
The Switch instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Switch) measure_styled

XuAPI
pub fn (sw &Switch) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Switch: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw &Switch
The Switch instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Switch) paint_styled

XuAPI
pub fn (sw &Switch) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Switch: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw &Switch
The Switch instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Switch) paint_position_styled

XuAPI
pub fn (sw &Switch) paint_position_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles,position f64) int

Purpose

Operation on &Switch: paint position styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw &Switch
The Switch instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
position f64
position (f64)

Returns

int — a value of this type

struct Radio

XuAPI
pub struct Radio {

}

Purpose

Radio context or state structure.

Public fields

This type has no public fields.

See usage example

radio

XuAPI
pub fn radio(identity &ui.CanvasEvent,id int,bounds &layout.Rect,option_value int,selected bool) Radio

Purpose

Execute radio. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
option_value int
option_value (int)
selected bool
selected (bool)

Returns

Radio — a value of this type

See usage example

(&Radio) id

XuAPI
pub fn (r &Radio) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

int — a value of this type

(&Radio) bounds

XuAPI
pub fn (r &Radio) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Radio) option

XuAPI
pub fn (r &Radio) option() int

Purpose

Execute option on &Radio.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

int — a value of this type

(&Radio) value

XuAPI
pub fn (r &Radio) value() bool

Purpose

Execute value on &Radio.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

($&Radio) set_value

XuAPI
pub fn (r $&Radio) set_value(selected bool)

Purpose

Operation on $&Radio: set value.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
selected bool
selected (bool)

Returns

This call does not return a value.

(&Radio) needs_paint

XuAPI
pub fn (r &Radio) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

($&Radio) painted

XuAPI
pub fn (r $&Radio) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Radio) invalidate

XuAPI
pub fn (r $&Radio) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Radio) cancel

XuAPI
pub fn (r $&Radio) cancel()

Purpose

Execute cancel on $&Radio.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Radio) is_enabled

XuAPI
pub fn (r &Radio) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

(&Radio) is_selectable

XuAPI
pub fn (r &Radio) is_selectable() bool

Purpose

Operation on &Radio: whether it is selectable.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

($&Radio) set_selectable

XuAPI
pub fn (r $&Radio) set_selectable(selectable bool)

Purpose

Operation on $&Radio: set selectable.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Radio) set_enabled

XuAPI
pub fn (r $&Radio) set_enabled(enabled bool)

Purpose

Operation on $&Radio: set enabled.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Radio) is_focused

XuAPI
pub fn (r &Radio) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

($&Radio) set_focus

XuAPI
pub fn (r $&Radio) set_focus(focused bool)

Purpose

Operation on $&Radio: set focus.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Radio) is_hovered

XuAPI
pub fn (r &Radio) is_hovered() bool

Purpose

Operation on &Radio: whether it is hovered.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

(&Radio) is_pressed

XuAPI
pub fn (r &Radio) is_pressed() bool

Purpose

Operation on &Radio: whether it is pressed.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

(&Radio) is_invalid

XuAPI
pub fn (r &Radio) is_invalid() bool

Purpose

Operation on &Radio: whether it is invalid.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

($&Radio) set_invalid

XuAPI
pub fn (r $&Radio) set_invalid(invalid bool)

Purpose

Operation on $&Radio: set invalid.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Radio) is_read_only

XuAPI
pub fn (r &Radio) is_read_only() bool

Purpose

Operation on &Radio: whether it is read only.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

($&Radio) set_read_only

XuAPI
pub fn (r $&Radio) set_read_only(read_only bool)

Purpose

Operation on $&Radio: set read only.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&Radio) set_bounds

XuAPI
pub fn (r $&Radio) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Radio: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Radio) visual_state

XuAPI
pub fn (r &Radio) visual_state() int

Purpose

Operation on &Radio: visual state.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

int — a value of this type

(&Radio) has_style

XuAPI
pub fn (r &Radio) has_style() bool

Purpose

Operation on &Radio: whether it has style.

Parameters

r &Radio
The Radio instance used by this call (borrow).

Returns

bool — true or false

(&Radio) style_or

XuAPI
pub fn (r &Radio) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Radio: style or.

Parameters

r &Radio
The Radio instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Radio) set_style

XuAPI
pub fn (r $&Radio) set_style(style &ControlStyle) int

Purpose

Operation on $&Radio: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Radio) clear_style

XuAPI
pub fn (r $&Radio) clear_style()

Purpose

Operation on $&Radio: clear style.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Radio) input

XuAPI
pub fn (r $&Radio) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Radio) event

XuAPI
pub fn (r $&Radio) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Radio) paint

XuAPI
pub fn (r &Radio) paint(frame $&draw.Frame,label &draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

r &Radio
The Radio instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Radio) measure_styled

XuAPI
pub fn (r &Radio) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Radio: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

r &Radio
The Radio instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Radio) paint_styled

XuAPI
pub fn (r &Radio) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Radio: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

r &Radio
The Radio instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Slider

XuAPI
pub struct Slider {

}

Purpose

Slider context or state structure.

Public fields

This type has no public fields.

See usage example

slider

XuAPI
pub fn slider(identity &ui.CanvasEvent,id int,bounds &layout.Rect,min f64,max f64,value f64) Slider

Purpose

Execute slider. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
min f64
minimum (f64)
max f64
maximum (f64)
value f64
value (f64)

Returns

Slider — a value of this type

See usage example

(&Slider) id

XuAPI
pub fn (s &Slider) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

int — a value of this type

(&Slider) is_selectable

XuAPI
pub fn (s &Slider) is_selectable() bool

Purpose

Operation on &Slider: whether it is selectable.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

($&Slider) set_selectable

XuAPI
pub fn (s $&Slider) set_selectable(selectable bool)

Purpose

Operation on $&Slider: set selectable.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Slider) bounds

XuAPI
pub fn (s &Slider) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Slider) value

XuAPI
pub fn (s &Slider) value() f64

Purpose

Execute value on &Slider.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

f64 — a value of this type

(&Slider) min

XuAPI
pub fn (s &Slider) min() f64

Purpose

Operation on &Slider: return the smaller of two numeric values.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

f64 — a value of this type

(&Slider) max

XuAPI
pub fn (s &Slider) max() f64

Purpose

Operation on &Slider: return the larger of two numeric values.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

f64 — a value of this type

(&Slider) step

XuAPI
pub fn (s &Slider) step() f64

Purpose

Execute step on &Slider.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

f64 — a value of this type

(&Slider) ratio

XuAPI
pub fn (s &Slider) ratio() f64

Purpose

Execute ratio on &Slider.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

f64 — a value of this type

(&Slider) needs_paint

XuAPI
pub fn (s &Slider) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

($&Slider) painted

XuAPI
pub fn (s $&Slider) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Slider) invalidate

XuAPI
pub fn (s $&Slider) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Slider) cancel

XuAPI
pub fn (s $&Slider) cancel()

Purpose

Execute cancel on $&Slider.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Slider) is_enabled

XuAPI
pub fn (s &Slider) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

($&Slider) set_enabled

XuAPI
pub fn (s $&Slider) set_enabled(enabled bool)

Purpose

Operation on $&Slider: set enabled.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Slider) is_focused

XuAPI
pub fn (s &Slider) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

($&Slider) set_focus

XuAPI
pub fn (s $&Slider) set_focus(focused bool)

Purpose

Operation on $&Slider: set focus.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Slider) is_hovered

XuAPI
pub fn (s &Slider) is_hovered() bool

Purpose

Operation on &Slider: whether it is hovered.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

(&Slider) is_dragging

XuAPI
pub fn (s &Slider) is_dragging() bool

Purpose

Operation on &Slider: whether it is dragging.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

(&Slider) is_invalid

XuAPI
pub fn (s &Slider) is_invalid() bool

Purpose

Operation on &Slider: whether it is invalid.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

($&Slider) set_invalid

XuAPI
pub fn (s $&Slider) set_invalid(invalid bool)

Purpose

Operation on $&Slider: set invalid.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Slider) is_read_only

XuAPI
pub fn (s &Slider) is_read_only() bool

Purpose

Operation on &Slider: whether it is read only.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

($&Slider) set_read_only

XuAPI
pub fn (s $&Slider) set_read_only(read_only bool)

Purpose

Operation on $&Slider: set read only.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&Slider) set_value

XuAPI
pub fn (s $&Slider) set_value(value f64) int

Purpose

Set a slider value, constrained by its configured range and step.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
value f64
Finite value; it is clamped to the range and snapped to the configured step.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Error handling

  • NaN or infinity throws widgets: invalid slider value.

($&Slider) set_range

XuAPI
pub fn (s $&Slider) set_range(min f64,max f64) int

Purpose

Operation on $&Slider: set range. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
min f64
minimum (f64)
max f64
maximum (f64)

Returns

int — a value of this type

($&Slider) set_step

XuAPI
pub fn (s $&Slider) set_step(step f64) int

Purpose

Operation on $&Slider: set step. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
step f64
step (f64)

Returns

int — a value of this type

($&Slider) set_bounds

XuAPI
pub fn (s $&Slider) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Slider: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Slider) visual_state

XuAPI
pub fn (s &Slider) visual_state() int

Purpose

Operation on &Slider: visual state.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

int — a value of this type

(&Slider) has_style

XuAPI
pub fn (s &Slider) has_style() bool

Purpose

Operation on &Slider: whether it has style.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

(&Slider) style_or

XuAPI
pub fn (s &Slider) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Slider: style or.

Parameters

s &Slider
The Slider instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Slider) set_style

XuAPI
pub fn (s $&Slider) set_style(style &ControlStyle) int

Purpose

Operation on $&Slider: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Slider) clear_style

XuAPI
pub fn (s $&Slider) clear_style()

Purpose

Operation on $&Slider: clear style.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Slider) input

XuAPI
pub fn (s $&Slider) input(input &ui.InputEvent) Action

Purpose

Handle dragging and keyboard adjustments, distinguishing live changes from a final commit.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
input &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • ACTION_CHANGE reports live changes; ACTION_COMMIT completes an interaction that changed the value. value is current; set_commit_only suppresses live change actions.

($&Slider) event

XuAPI
pub fn (s $&Slider) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Slider) paint

XuAPI
pub fn (s &Slider) paint(frame $&draw.Frame,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Slider
The Slider instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Slider) measure_styled

XuAPI
pub fn (s &Slider) measure_styled(styles &Styles) layout.Size

Purpose

Operation on &Slider: measure styled.

Parameters

s &Slider
The Slider instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Slider) paint_styled

XuAPI
pub fn (s &Slider) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on &Slider: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Slider
The Slider instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Slider) set_commit_only

XuAPI
pub fn (s $&Slider) set_commit_only(enabled bool)

Purpose

Emit only final commit actions when applying changes is expensive.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
enabled bool
true suppresses live ACTION_CHANGE while retaining the final ACTION_COMMIT.

Returns

No return value; setting this clears the current pending-commit flag.

Usage notes

  • The displayed value still updates during dragging; apply expensive work when handling the commit action.

($&Switch) set_motion

XuAPI
pub fn (sw $&Switch) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Switch: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Switch) tick

XuAPI
pub fn (sw $&Switch) tick(now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&Switch) next_tick

XuAPI
pub fn (sw &Switch) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Switch: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw &Switch
The Switch instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&Slider) apply_styles

XuAPI
pub fn (s $&Slider) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Stepper

XuAPI
pub struct Stepper {

}

Purpose

Stepper context or state structure.

Public fields

This type has no public fields.

See usage example

stepper

XuAPI
pub fn stepper(identity &ui.CanvasEvent,id int,bounds &layout.Rect,min f64,max f64,step f64,value f64) Stepper

Purpose

Execute stepper. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
min f64
minimum (f64)
max f64
maximum (f64)
step f64
step (f64)
value f64
value (f64)

Returns

Stepper — a value of this type

See usage example

(&Stepper) id

XuAPI
pub fn (st &Stepper) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

int — a value of this type

(&Stepper) is_selectable

XuAPI
pub fn (st &Stepper) is_selectable() bool

Purpose

Operation on &Stepper: whether it is selectable.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

($&Stepper) set_selectable

XuAPI
pub fn (st $&Stepper) set_selectable(selectable bool)

Purpose

Operation on $&Stepper: set selectable.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Stepper) bounds

XuAPI
pub fn (st &Stepper) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Stepper) value

XuAPI
pub fn (st &Stepper) value() f64

Purpose

Execute value on &Stepper.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

f64 — a value of this type

(&Stepper) min

XuAPI
pub fn (st &Stepper) min() f64

Purpose

Operation on &Stepper: return the smaller of two numeric values.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

f64 — a value of this type

(&Stepper) max

XuAPI
pub fn (st &Stepper) max() f64

Purpose

Operation on &Stepper: return the larger of two numeric values.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

f64 — a value of this type

(&Stepper) step

XuAPI
pub fn (st &Stepper) step() f64

Purpose

Execute step on &Stepper.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

f64 — a value of this type

(&Stepper) can_decrement

XuAPI
pub fn (st &Stepper) can_decrement() bool

Purpose

Operation on &Stepper: can decrement.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

(&Stepper) can_increment

XuAPI
pub fn (st &Stepper) can_increment() bool

Purpose

Operation on &Stepper: can increment.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

(&Stepper) needs_paint

XuAPI
pub fn (st &Stepper) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

($&Stepper) painted

XuAPI
pub fn (st $&Stepper) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Stepper) invalidate

XuAPI
pub fn (st $&Stepper) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Stepper) cancel

XuAPI
pub fn (st $&Stepper) cancel()

Purpose

Execute cancel on $&Stepper.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Stepper) is_enabled

XuAPI
pub fn (st &Stepper) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

($&Stepper) set_enabled

XuAPI
pub fn (st $&Stepper) set_enabled(enabled bool)

Purpose

Operation on $&Stepper: set enabled.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Stepper) is_focused

XuAPI
pub fn (st &Stepper) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

($&Stepper) set_focus

XuAPI
pub fn (st $&Stepper) set_focus(focused bool)

Purpose

Operation on $&Stepper: set focus.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Stepper) is_hovered

XuAPI
pub fn (st &Stepper) is_hovered() bool

Purpose

Operation on &Stepper: whether it is hovered.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

(&Stepper) is_invalid

XuAPI
pub fn (st &Stepper) is_invalid() bool

Purpose

Operation on &Stepper: whether it is invalid.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

($&Stepper) set_invalid

XuAPI
pub fn (st $&Stepper) set_invalid(invalid bool)

Purpose

Operation on $&Stepper: set invalid.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Stepper) is_read_only

XuAPI
pub fn (st &Stepper) is_read_only() bool

Purpose

Operation on &Stepper: whether it is read only.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

($&Stepper) set_read_only

XuAPI
pub fn (st $&Stepper) set_read_only(read_only bool)

Purpose

Operation on $&Stepper: set read only.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&Stepper) set_value

XuAPI
pub fn (st $&Stepper) set_value(value f64) int

Purpose

Operation on $&Stepper: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
value f64
value (f64)

Returns

int — a value of this type

($&Stepper) set_range

XuAPI
pub fn (st $&Stepper) set_range(min f64,max f64,step f64) int

Purpose

Operation on $&Stepper: set range. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
min f64
minimum (f64)
max f64
maximum (f64)
step f64
step (f64)

Returns

int — a value of this type

($&Stepper) set_bounds

XuAPI
pub fn (st $&Stepper) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Stepper: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Stepper) visual_state

XuAPI
pub fn (st &Stepper) visual_state() int

Purpose

Operation on &Stepper: visual state.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

int — a value of this type

(&Stepper) has_style

XuAPI
pub fn (st &Stepper) has_style() bool

Purpose

Operation on &Stepper: whether it has style.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).

Returns

bool — true or false

(&Stepper) style_or

XuAPI
pub fn (st &Stepper) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Stepper: style or.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Stepper) set_style

XuAPI
pub fn (st $&Stepper) set_style(style &ControlStyle) int

Purpose

Operation on $&Stepper: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Stepper) clear_style

XuAPI
pub fn (st $&Stepper) clear_style()

Purpose

Operation on $&Stepper: clear style.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Stepper) input

XuAPI
pub fn (st $&Stepper) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Stepper) event

XuAPI
pub fn (st $&Stepper) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Stepper) paint

XuAPI
pub fn (st &Stepper) paint(frame $&draw.Frame,label &draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Stepper) measure_styled

XuAPI
pub fn (st &Stepper) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Stepper: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Stepper) paint_styled

XuAPI
pub fn (st &Stepper) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Stepper: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct ListBox

XuAPI
pub struct ListBox {

}

Purpose

ListBox context or state structure.

Public fields

This type has no public fields.

See usage example

list_box

XuAPI
pub fn list_box(identity &ui.CanvasEvent,id int,bounds &layout.Rect,count int,selected int) ListBox

Purpose

List box. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
count int
count (int)
selected int
selected (int)

Returns

ListBox — a value of this type

See usage example

(&ListBox) id

XuAPI
pub fn (lb &ListBox) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) bounds

XuAPI
pub fn (lb &ListBox) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ListBox) count

XuAPI
pub fn (lb &ListBox) count() int

Purpose

Return the number of items in this control.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) selected

XuAPI
pub fn (lb &ListBox) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) hovered_item

XuAPI
pub fn (lb &ListBox) hovered_item() int

Purpose

Operation on &ListBox: hovered item.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) scroll_offset

XuAPI
pub fn (lb &ListBox) scroll_offset() f64

Purpose

Operation on &ListBox: scroll offset.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

f64 — a value of this type

(&ListBox) is_selectable

XuAPI
pub fn (lb &ListBox) is_selectable() bool

Purpose

Operation on &ListBox: whether it is selectable.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

($&ListBox) set_selectable

XuAPI
pub fn (lb $&ListBox) set_selectable(selectable bool)

Purpose

Operation on $&ListBox: set selectable.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&ListBox) has_popup_open

XuAPI
pub fn (lb &ListBox) has_popup_open() bool

Purpose

Operation on &ListBox: whether it has popup open.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

(&ListBox) popup_bounds

XuAPI
pub fn (lb &ListBox) popup_bounds() layout.Rect

Purpose

Operation on &ListBox: popup bounds.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ListBox) cursor

XuAPI
pub fn (lb &ListBox) cursor() int

Purpose

Execute cursor on &ListBox.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

($&ListBox) set_locale

XuAPI
pub fn (lb $&ListBox) set_locale(locale &Locale) int

Purpose

Operation on $&ListBox: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&ListBox) set_viewport

XuAPI
pub fn (lb $&ListBox) set_viewport(viewport &layout.Rect,context &draw.Context)

Purpose

Operation on $&ListBox: set viewport.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)

Returns

This call does not return a value.

($&ListBox) paint_popup_styled

XuAPI
pub fn (lb $&ListBox) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&ListBox: paint popup styled.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&ListBox) dispose_aux

XuAPI
pub fn (lb $&ListBox) dispose_aux()

Purpose

Operation on $&ListBox: dispose aux.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ListBox) set_styles_cache

XuAPI
pub fn (lb $&ListBox) set_styles_cache(styles &Styles)

Purpose

Operation on $&ListBox: set styles cache.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

This call does not return a value.

(&ListBox) style_snapshot

XuAPI
pub fn (lb &ListBox) style_snapshot() Styles

Purpose

Operation on &ListBox: style snapshot.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

Styles — a value of this type

(&ListBox) has_selection_for_row

XuAPI
pub fn (lb &ListBox) has_selection_for_row(row int) bool

Purpose

Operation on &ListBox: whether it has selection for row.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
row int
row (int)

Returns

bool — true or false

(&ListBox) row_sel_anchor

XuAPI
pub fn (lb &ListBox) row_sel_anchor() int

Purpose

Operation on &ListBox: row sel anchor.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) row_sel_focus

XuAPI
pub fn (lb &ListBox) row_sel_focus() int

Purpose

Operation on &ListBox: row sel focus.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) selected_text

XuAPI
pub fn (lb &ListBox) selected_text() string

Purpose

Operation on &ListBox: selected text.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

string — result string

($&ListBox) route_popup

XuAPI
pub fn (lb $&ListBox) route_popup(event &ui.InputEvent) Action

Purpose

Operation on $&ListBox: route popup.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ListBox) handle_text_key

XuAPI
pub fn (lb $&ListBox) handle_text_key(event &ui.InputEvent) Action

Purpose

Operation on $&ListBox: handle text key.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ListBox) ensure_row_text

XuAPI
pub fn (lb $&ListBox) ensure_row_text(row int,col int,text &string,row_text &string)

Purpose

Operation on $&ListBox: ensure row text.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
row int
row (int)
col int
col (int)
text &string
text (read-only borrow; caller keeps the original; type &string)
row_text &string
row_text (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&ListBox) open_row_menu

XuAPI
pub fn (lb $&ListBox) open_row_menu(context &draw.Context,x f64,y f64,text &string,row_text &string,row int,col int,show_row bool) bool

Purpose

Operation on $&ListBox: open row menu.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
x f64
value (f64)
y f64
value (f64)
text &string
text (read-only borrow; caller keeps the original; type &string)
row_text &string
row_text (read-only borrow; caller keeps the original; type &string)
row int
row (int)
col int
col (int)
show_row bool
show_row (bool)

Returns

bool — true or false

($&ListBox) begin_row_pointer

XuAPI
pub fn (lb $&ListBox) begin_row_pointer(text &string,row_text &string,idx int,row int,col int,event &ui.InputEvent) bool

Purpose

Operation on $&ListBox: begin row pointer.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
row_text &string
row_text (read-only borrow; caller keeps the original; type &string)
idx int
idx (int)
row int
row (int)
col int
col (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

bool — true or false

($&ListBox) should_begin_row_drag

XuAPI
pub fn (lb $&ListBox) should_begin_row_drag(x f64,y f64,density f64) bool

Purpose

Operation on $&ListBox: should begin row drag.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
density f64
density (f64)

Returns

bool — true or false

($&ListBox) drag_row_pointer

XuAPI
pub fn (lb $&ListBox) drag_row_pointer(idx int) bool

Purpose

Operation on $&ListBox: drag row pointer.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
idx int
idx (int)

Returns

bool — true or false

($&ListBox) end_row_pointer

XuAPI
pub fn (lb $&ListBox) end_row_pointer()

Purpose

Operation on $&ListBox: end row pointer.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ListBox) clear_text_selection

XuAPI
pub fn (lb $&ListBox) clear_text_selection()

Purpose

Operation on $&ListBox: clear text selection.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&ListBox) needs_paint

XuAPI
pub fn (lb &ListBox) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

($&ListBox) painted

XuAPI
pub fn (lb $&ListBox) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ListBox) invalidate

XuAPI
pub fn (lb $&ListBox) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ListBox) cancel

XuAPI
pub fn (lb $&ListBox) cancel()

Purpose

Execute cancel on $&ListBox.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&ListBox) is_enabled

XuAPI
pub fn (lb &ListBox) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

($&ListBox) set_enabled

XuAPI
pub fn (lb $&ListBox) set_enabled(enabled bool)

Purpose

Operation on $&ListBox: set enabled.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&ListBox) is_focused

XuAPI
pub fn (lb &ListBox) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

($&ListBox) set_focus

XuAPI
pub fn (lb $&ListBox) set_focus(focused bool)

Purpose

Operation on $&ListBox: set focus.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&ListBox) is_hovered

XuAPI
pub fn (lb &ListBox) is_hovered() bool

Purpose

Operation on &ListBox: whether it is hovered.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

(&ListBox) is_invalid

XuAPI
pub fn (lb &ListBox) is_invalid() bool

Purpose

Operation on &ListBox: whether it is invalid.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

($&ListBox) set_invalid

XuAPI
pub fn (lb $&ListBox) set_invalid(invalid bool)

Purpose

Operation on $&ListBox: set invalid.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&ListBox) is_read_only

XuAPI
pub fn (lb &ListBox) is_read_only() bool

Purpose

Operation on &ListBox: whether it is read only.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

($&ListBox) set_read_only

XuAPI
pub fn (lb $&ListBox) set_read_only(read_only bool)

Purpose

Operation on $&ListBox: set read only.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&ListBox) set_scroll_offset

XuAPI
pub fn (lb $&ListBox) set_scroll_offset(offset f64) int

Purpose

Operation on $&ListBox: set scroll offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
offset f64
offset (f64)

Returns

int — a value of this type

($&ListBox) ensure_visible

XuAPI
pub fn (lb $&ListBox) ensure_visible(index int)

Purpose

Operation on $&ListBox: ensure visible.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
index int
index (int)

Returns

This call does not return a value.

($&ListBox) set_count

XuAPI
pub fn (lb $&ListBox) set_count(count int) int

Purpose

Operation on $&ListBox: set count. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
count int
count (int)

Returns

int — a value of this type

($&ListBox) set_selected

XuAPI
pub fn (lb $&ListBox) set_selected(index int) int

Purpose

Operation on $&ListBox: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&ListBox) set_bounds

XuAPI
pub fn (lb $&ListBox) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&ListBox: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&ListBox) visual_state

XuAPI
pub fn (lb &ListBox) visual_state() int

Purpose

Operation on &ListBox: visual state.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) item_visual_state

XuAPI
pub fn (lb &ListBox) item_visual_state(index int) int

Purpose

Operation on &ListBox: item visual state.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
index int
index (int)

Returns

int — a value of this type

(&ListBox) has_style

XuAPI
pub fn (lb &ListBox) has_style() bool

Purpose

Operation on &ListBox: whether it has style.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).

Returns

bool — true or false

(&ListBox) style_or

XuAPI
pub fn (lb &ListBox) style_or(styles &Styles) ControlStyle

Purpose

Operation on &ListBox: style or.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&ListBox) set_style

XuAPI
pub fn (lb $&ListBox) set_style(style &ControlStyle) int

Purpose

Operation on $&ListBox: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&ListBox) clear_style

XuAPI
pub fn (lb $&ListBox) clear_style()

Purpose

Operation on $&ListBox: clear style.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ListBox) apply_styles

XuAPI
pub fn (lb $&ListBox) apply_styles(styles &Styles) int

Purpose

Apply resolved metrics before routing input, just as Scroll and Editor do. Painting, scrolling and pointer hit testing must share the same row geometry. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&ListBox) hit_row

XuAPI
pub fn (lb &ListBox) hit_row(x f64,y f64) int

Purpose

Operation on &ListBox: hit row.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&ListBox) input

XuAPI
pub fn (lb $&ListBox) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ListBox) event

XuAPI
pub fn (lb $&ListBox) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&ListBox) paint

XuAPI
pub fn (lb &ListBox) paint(frame $&draw.Frame,labels &[]draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
labels &[]draw.TextLayout
labels (read-only borrow; caller keeps the original; type &[]draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&ListBox) measure_styled

XuAPI
pub fn (lb &ListBox) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &ListBox: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&ListBox) paint_box_styled

XuAPI
pub fn (lb &ListBox) paint_box_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on &ListBox: paint box styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&ListBox) paint_item_styled

XuAPI
pub fn (lb &ListBox) paint_item_styled(frame $&draw.Frame,index int,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &ListBox: paint item styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
index int
index (int)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&ListBox) paint_styled

XuAPI
pub fn (lb &ListBox) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &ListBox: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Stepper) set_repeat

XuAPI
pub fn (st $&Stepper) set_repeat(enabled bool,delay time.Duration,interval time.Duration) int

Purpose

Operation on $&Stepper: set repeat. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
enabled bool
enabled (bool)
delay time.Duration
delay (time.Duration)
interval time.Duration
interval (time.Duration)

Returns

int — a value of this type

($&Stepper) apply_styles

XuAPI
pub fn (st $&Stepper) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Stepper) next_tick

XuAPI
pub fn (st &Stepper) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Stepper: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

st &Stepper
The Stepper instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&Stepper) tick

XuAPI
pub fn (st $&Stepper) tick(now time.Instant) Action

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

Action — input result with kind, id, repaint and focus requests.

struct Divider

XuAPI
pub struct Divider {

}

Purpose

Divider context or state structure.

Public fields

This type has no public fields.

See usage example

divider

XuAPI
pub fn divider(bounds &layout.Rect,axis int) Divider

Purpose

Execute divider. Throws on failure; handle the error or propagate it to the caller.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
axis int
axis (int)

Returns

Divider — a value of this type

See usage example

(&Divider) is_selectable

XuAPI
pub fn (div &Divider) is_selectable() bool

Purpose

Operation on &Divider: whether it is selectable.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

bool — true or false

($&Divider) set_selectable

XuAPI
pub fn (div $&Divider) set_selectable(selectable bool)

Purpose

Operation on $&Divider: set selectable.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Divider) axis

XuAPI
pub fn (div &Divider) axis() int

Purpose

Execute axis on &Divider.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

int — a value of this type

($&Divider) set_axis

XuAPI
pub fn (div $&Divider) set_axis(axis int) int

Purpose

Operation on $&Divider: set axis. Throws on failure; handle the error or propagate it to the caller.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
axis int
axis (int)

Returns

int — a value of this type

(&Divider) bounds

XuAPI
pub fn (div &Divider) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Divider) set_bounds

XuAPI
pub fn (div $&Divider) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Divider: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Divider) needs_paint

XuAPI
pub fn (div &Divider) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

bool — true or false

($&Divider) painted

XuAPI
pub fn (div $&Divider) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Divider) invalidate

XuAPI
pub fn (div $&Divider) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Divider) is_enabled

XuAPI
pub fn (div &Divider) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

bool — true or false

($&Divider) set_enabled

XuAPI
pub fn (div $&Divider) set_enabled(enabled bool)

Purpose

Operation on $&Divider: set enabled.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Divider) is_invalid

XuAPI
pub fn (div &Divider) is_invalid() bool

Purpose

Operation on &Divider: whether it is invalid.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

bool — true or false

($&Divider) set_invalid

XuAPI
pub fn (div $&Divider) set_invalid(invalid bool)

Purpose

Operation on $&Divider: set invalid.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Divider) is_selected

XuAPI
pub fn (div &Divider) is_selected() bool

Purpose

Operation on &Divider: whether it is selected.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

bool — true or false

($&Divider) set_selected

XuAPI
pub fn (div $&Divider) set_selected(selected bool)

Purpose

Operation on $&Divider: set selected.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
selected bool
selected (bool)

Returns

This call does not return a value.

(&Divider) visual_state

XuAPI
pub fn (div &Divider) visual_state() int

Purpose

Operation on &Divider: visual state.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

int — a value of this type

(&Divider) has_style

XuAPI
pub fn (div &Divider) has_style() bool

Purpose

Operation on &Divider: whether it has style.

Parameters

div &Divider
The Divider instance used by this call (borrow).

Returns

bool — true or false

(&Divider) style_or

XuAPI
pub fn (div &Divider) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Divider: style or.

Parameters

div &Divider
The Divider instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Divider) set_style

XuAPI
pub fn (div $&Divider) set_style(style &ControlStyle) int

Purpose

Operation on $&Divider: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Divider) clear_style

XuAPI
pub fn (div $&Divider) clear_style()

Purpose

Operation on $&Divider: clear style.

Parameters

div $&Divider
The Divider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Divider) paint

XuAPI
pub fn (div &Divider) paint(frame $&draw.Frame,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

div &Divider
The Divider instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Divider) measure_styled

XuAPI
pub fn (div &Divider) measure_styled(styles &Styles) layout.Size

Purpose

Operation on &Divider: measure styled.

Parameters

div &Divider
The Divider instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Divider) measure_labeled_styled

XuAPI
pub fn (div &Divider) measure_labeled_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Divider: measure labeled styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

div &Divider
The Divider instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Divider) paint_styled

XuAPI
pub fn (div &Divider) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on &Divider: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

div &Divider
The Divider instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Divider) paint_labeled_styled

XuAPI
pub fn (div &Divider) paint_labeled_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Divider: paint labeled styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

div &Divider
The Divider instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Badge

XuAPI
pub struct Badge {

}

Purpose

Badge context or state structure.

Public fields

This type has no public fields.

See usage example

badge

XuAPI
pub fn badge(bounds &layout.Rect) Badge

Purpose

Execute badge. Throws on failure; handle the error or propagate it to the caller.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Badge — a value of this type

See usage example

(&Badge) is_selectable

XuAPI
pub fn (bg &Badge) is_selectable() bool

Purpose

Operation on &Badge: whether it is selectable.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) set_selectable

XuAPI
pub fn (bg $&Badge) set_selectable(selectable bool)

Purpose

Operation on $&Badge: set selectable.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Badge) bounds

XuAPI
pub fn (bg &Badge) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Badge) set_bounds

XuAPI
pub fn (bg $&Badge) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Badge: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Badge) needs_paint

XuAPI
pub fn (bg &Badge) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) painted

XuAPI
pub fn (bg $&Badge) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Badge) invalidate

XuAPI
pub fn (bg $&Badge) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Badge) is_enabled

XuAPI
pub fn (bg &Badge) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) set_enabled

XuAPI
pub fn (bg $&Badge) set_enabled(enabled bool)

Purpose

Operation on $&Badge: set enabled.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Badge) is_selected

XuAPI
pub fn (bg &Badge) is_selected() bool

Purpose

Operation on &Badge: whether it is selected.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) set_selected

XuAPI
pub fn (bg $&Badge) set_selected(selected bool)

Purpose

Operation on $&Badge: set selected.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
selected bool
selected (bool)

Returns

This call does not return a value.

(&Badge) is_invalid

XuAPI
pub fn (bg &Badge) is_invalid() bool

Purpose

Operation on &Badge: whether it is invalid.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) set_invalid

XuAPI
pub fn (bg $&Badge) set_invalid(invalid bool)

Purpose

Operation on $&Badge: set invalid.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Badge) is_focused

XuAPI
pub fn (bg &Badge) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) set_focus

XuAPI
pub fn (bg $&Badge) set_focus(focused bool)

Purpose

Operation on $&Badge: set focus.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Badge) is_hovered

XuAPI
pub fn (bg &Badge) is_hovered() bool

Purpose

Operation on &Badge: whether it is hovered.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

($&Badge) set_hovered

XuAPI
pub fn (bg $&Badge) set_hovered(hovered bool)

Purpose

Operation on $&Badge: set hovered.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
hovered bool
hovered (bool)

Returns

This call does not return a value.

(&Badge) visual_state

XuAPI
pub fn (bg &Badge) visual_state() int

Purpose

Operation on &Badge: visual state.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

int — a value of this type

(&Badge) has_style

XuAPI
pub fn (bg &Badge) has_style() bool

Purpose

Operation on &Badge: whether it has style.

Parameters

bg &Badge
The Badge instance used by this call (borrow).

Returns

bool — true or false

(&Badge) style_or

XuAPI
pub fn (bg &Badge) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Badge: style or.

Parameters

bg &Badge
The Badge instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Badge) set_style

XuAPI
pub fn (bg $&Badge) set_style(style &ControlStyle) int

Purpose

Operation on $&Badge: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Badge) clear_style

XuAPI
pub fn (bg $&Badge) clear_style()

Purpose

Operation on $&Badge: clear style.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Badge) paint

XuAPI
pub fn (bg &Badge) paint(frame $&draw.Frame,label &draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

bg &Badge
The Badge instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label &draw.TextLayout
label (read-only borrow; caller keeps the original; type &draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Badge) measure_styled

XuAPI
pub fn (bg &Badge) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Badge: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

bg &Badge
The Badge instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Badge) paint_styled

XuAPI
pub fn (bg &Badge) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Badge: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

bg &Badge
The Badge instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Card

XuAPI
pub struct Card {

}

Purpose

Card context or state structure.

Public fields

This type has no public fields.

See usage example

card

XuAPI
pub fn card(bounds &layout.Rect) Card

Purpose

Execute card. Throws on failure; handle the error or propagate it to the caller.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Card — a value of this type

See usage example

(&Card) is_selectable

XuAPI
pub fn (cd &Card) is_selectable() bool

Purpose

Operation on &Card: whether it is selectable.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) set_selectable

XuAPI
pub fn (cd $&Card) set_selectable(selectable bool)

Purpose

Operation on $&Card: set selectable.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Card) bounds

XuAPI
pub fn (cd &Card) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Card) set_bounds

XuAPI
pub fn (cd $&Card) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Card: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Card) content_bounds

XuAPI
pub fn (cd &Card) content_bounds(styles &Styles) layout.Rect

Purpose

Operation on &Card: content bounds.

Parameters

cd &Card
The Card instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Rect — a value of this type

(&Card) needs_paint

XuAPI
pub fn (cd &Card) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) painted

XuAPI
pub fn (cd $&Card) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Card) invalidate

XuAPI
pub fn (cd $&Card) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Card) is_enabled

XuAPI
pub fn (cd &Card) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) set_enabled

XuAPI
pub fn (cd $&Card) set_enabled(enabled bool)

Purpose

Operation on $&Card: set enabled.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Card) is_selected

XuAPI
pub fn (cd &Card) is_selected() bool

Purpose

Operation on &Card: whether it is selected.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) set_selected

XuAPI
pub fn (cd $&Card) set_selected(selected bool)

Purpose

Operation on $&Card: set selected.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
selected bool
selected (bool)

Returns

This call does not return a value.

(&Card) is_invalid

XuAPI
pub fn (cd &Card) is_invalid() bool

Purpose

Operation on &Card: whether it is invalid.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) set_invalid

XuAPI
pub fn (cd $&Card) set_invalid(invalid bool)

Purpose

Operation on $&Card: set invalid.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Card) is_focused

XuAPI
pub fn (cd &Card) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) set_focus

XuAPI
pub fn (cd $&Card) set_focus(focused bool)

Purpose

Operation on $&Card: set focus.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Card) is_hovered

XuAPI
pub fn (cd &Card) is_hovered() bool

Purpose

Operation on &Card: whether it is hovered.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

($&Card) set_hovered

XuAPI
pub fn (cd $&Card) set_hovered(hovered bool)

Purpose

Operation on $&Card: set hovered.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
hovered bool
hovered (bool)

Returns

This call does not return a value.

(&Card) visual_state

XuAPI
pub fn (cd &Card) visual_state() int

Purpose

Operation on &Card: visual state.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

int — a value of this type

(&Card) has_style

XuAPI
pub fn (cd &Card) has_style() bool

Purpose

Operation on &Card: whether it has style.

Parameters

cd &Card
The Card instance used by this call (borrow).

Returns

bool — true or false

(&Card) style_or

XuAPI
pub fn (cd &Card) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Card: style or.

Parameters

cd &Card
The Card instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Card) set_style

XuAPI
pub fn (cd $&Card) set_style(style &ControlStyle) int

Purpose

Operation on $&Card: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Card) clear_style

XuAPI
pub fn (cd $&Card) clear_style()

Purpose

Operation on $&Card: clear style.

Parameters

cd $&Card
The Card instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Card) paint

XuAPI
pub fn (cd &Card) paint(frame $&draw.Frame,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

cd &Card
The Card instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Card) measure_styled

XuAPI
pub fn (cd &Card) measure_styled(styles &Styles) layout.Size

Purpose

Operation on &Card: measure styled.

Parameters

cd &Card
The Card instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Card) measure_header_styled

XuAPI
pub fn (cd &Card) measure_header_styled(title $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Card: measure header styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

cd &Card
The Card instance used by this call (borrow).
title $&StyledLabel
title (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Card) paint_styled

XuAPI
pub fn (cd &Card) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on &Card: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

cd &Card
The Card instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Card) paint_header_styled

XuAPI
pub fn (cd &Card) paint_header_styled(frame $&draw.Frame,title $&StyledLabel,styles &Styles) int

Purpose

Operation on &Card: paint header styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

cd &Card
The Card instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
title $&StyledLabel
title (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Badge) set_tone

XuAPI
pub fn (bg $&Badge) set_tone(tone int) int

Purpose

Operation on $&Badge: set tone. Throws on failure; handle the error or propagate it to the caller.

Parameters

bg $&Badge
The Badge instance used by this call (exclusive borrow).
tone int
tone (int)

Returns

int — a value of this type

struct Tabs

XuAPI
pub struct Tabs {

}

Purpose

Tabs context or state structure.

Public fields

This type has no public fields.

See usage example

tabs

XuAPI
pub fn tabs(identity &ui.CanvasEvent,id int,bounds &layout.Rect,count int,selected int) Tabs

Purpose

Execute tabs. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
count int
count (int)
selected int
selected (int)

Returns

Tabs — a value of this type

See usage example

(&Tabs) is_selectable

XuAPI
pub fn (t &Tabs) is_selectable() bool

Purpose

Operation on &Tabs: whether it is selectable.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

($&Tabs) set_selectable

XuAPI
pub fn (t $&Tabs) set_selectable(selectable bool)

Purpose

Operation on $&Tabs: set selectable.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

segmented

XuAPI
pub fn segmented(identity &ui.CanvasEvent,id int,bounds &layout.Rect,count int,selected int) Tabs

Purpose

Execute segmented. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
count int
count (int)
selected int
selected (int)

Returns

Tabs — a value of this type

(&Tabs) id

XuAPI
pub fn (t &Tabs) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

int — a value of this type

(&Tabs) bounds

XuAPI
pub fn (t &Tabs) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Tabs) count

XuAPI
pub fn (t &Tabs) count() int

Purpose

Return the number of items in this control.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

int — a value of this type

(&Tabs) selected

XuAPI
pub fn (t &Tabs) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

int — a value of this type

(&Tabs) hovered_item

XuAPI
pub fn (t &Tabs) hovered_item() int

Purpose

Operation on &Tabs: hovered item.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

int — a value of this type

(&Tabs) needs_paint

XuAPI
pub fn (t &Tabs) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

($&Tabs) painted

XuAPI
pub fn (t $&Tabs) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Tabs) invalidate

XuAPI
pub fn (t $&Tabs) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Tabs) cancel

XuAPI
pub fn (t $&Tabs) cancel()

Purpose

Execute cancel on $&Tabs.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Tabs) is_enabled

XuAPI
pub fn (t &Tabs) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

($&Tabs) set_enabled

XuAPI
pub fn (t $&Tabs) set_enabled(enabled bool)

Purpose

Operation on $&Tabs: set enabled.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Tabs) is_focused

XuAPI
pub fn (t &Tabs) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

($&Tabs) set_focus

XuAPI
pub fn (t $&Tabs) set_focus(focused bool)

Purpose

Operation on $&Tabs: set focus.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Tabs) is_hovered

XuAPI
pub fn (t &Tabs) is_hovered() bool

Purpose

Operation on &Tabs: whether it is hovered.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

(&Tabs) is_invalid

XuAPI
pub fn (t &Tabs) is_invalid() bool

Purpose

Operation on &Tabs: whether it is invalid.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

($&Tabs) set_invalid

XuAPI
pub fn (t $&Tabs) set_invalid(invalid bool)

Purpose

Operation on $&Tabs: set invalid.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Tabs) is_read_only

XuAPI
pub fn (t &Tabs) is_read_only() bool

Purpose

Operation on &Tabs: whether it is read only.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

($&Tabs) set_read_only

XuAPI
pub fn (t $&Tabs) set_read_only(read_only bool)

Purpose

Operation on $&Tabs: set read only.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&Tabs) set_count

XuAPI
pub fn (t $&Tabs) set_count(count int) int

Purpose

Operation on $&Tabs: set count. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
count int
count (int)

Returns

int — a value of this type

($&Tabs) set_selected

XuAPI
pub fn (t $&Tabs) set_selected(index int) int

Purpose

Operation on $&Tabs: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&Tabs) set_bounds

XuAPI
pub fn (t $&Tabs) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Tabs: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Tabs) visual_state

XuAPI
pub fn (t &Tabs) visual_state() int

Purpose

Operation on &Tabs: visual state.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

int — a value of this type

(&Tabs) item_visual_state

XuAPI
pub fn (t &Tabs) item_visual_state(index int) int

Purpose

Operation on &Tabs: item visual state.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
index int
index (int)

Returns

int — a value of this type

(&Tabs) has_style

XuAPI
pub fn (t &Tabs) has_style() bool

Purpose

Operation on &Tabs: whether it has style.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

(&Tabs) style_or

XuAPI
pub fn (t &Tabs) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Tabs: style or.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Tabs) set_style

XuAPI
pub fn (t $&Tabs) set_style(style &ControlStyle) int

Purpose

Operation on $&Tabs: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Tabs) clear_style

XuAPI
pub fn (t $&Tabs) clear_style()

Purpose

Operation on $&Tabs: clear style.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Tabs) item_bounds

XuAPI
pub fn (t &Tabs) item_bounds(index int,styles &Styles) layout.Rect

Purpose

Operation on &Tabs: item bounds.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
index int
index (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Rect — a value of this type

($&Tabs) apply_styles

XuAPI
pub fn (t $&Tabs) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Tabs) set_item_widths

XuAPI
pub fn (t $&Tabs) set_item_widths(widths &[]f64) int

Purpose

Operation on $&Tabs: set item widths. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
widths &[]f64
widths (read-only borrow; caller keeps the original; type &[]f64)

Returns

int — a value of this type

($&Tabs) set_automatic_activation

XuAPI
pub fn (t $&Tabs) set_automatic_activation(automatic bool)

Purpose

Operation on $&Tabs: set automatic activation.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
automatic bool
automatic (bool)

Returns

This call does not return a value.

($&Tabs) input

XuAPI
pub fn (t $&Tabs) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Tabs) event

XuAPI
pub fn (t $&Tabs) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Tabs) paint

XuAPI
pub fn (t &Tabs) paint(frame $&draw.Frame,labels &[]draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
labels &[]draw.TextLayout
labels (read-only borrow; caller keeps the original; type &[]draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Tabs) measure_styled

XuAPI
pub fn (t &Tabs) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Tabs: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Tabs) paint_box_styled

XuAPI
pub fn (t &Tabs) paint_box_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on &Tabs: paint box styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Tabs) paint_tab_styled

XuAPI
pub fn (t &Tabs) paint_tab_styled(frame $&draw.Frame,index int,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Tabs: paint tab styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
index int
index (int)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Tabs) paint_styled

XuAPI
pub fn (t &Tabs) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Tabs: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Select

XuAPI
pub struct Select {

}

Purpose

Select context or state structure.

Public fields

This type has no public fields.

See usage example

select_box

XuAPI
pub fn select_box(identity &ui.CanvasEvent,id int,bounds &layout.Rect,count int,selected int) Select

Purpose

Select box. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
count int
count (int)
selected int
selected (int)

Returns

Select — a value of this type

See usage example

(&Select) is_selectable

XuAPI
pub fn (sel &Select) is_selectable() bool

Purpose

Operation on &Select: whether it is selectable.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

($&Select) set_selectable

XuAPI
pub fn (sel $&Select) set_selectable(selectable bool)

Purpose

Operation on $&Select: set selectable.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Select) id

XuAPI
pub fn (sel &Select) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

int — a value of this type

(&Select) bounds

XuAPI
pub fn (sel &Select) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Select) count

XuAPI
pub fn (sel &Select) count() int

Purpose

Return the number of items in this control.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

int — a value of this type

(&Select) selected

XuAPI
pub fn (sel &Select) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

int — a value of this type

(&Select) is_open

XuAPI
pub fn (sel &Select) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

(&Select) hovered_option

XuAPI
pub fn (sel &Select) hovered_option() int

Purpose

Return the hovered option index, or -1 when no option is hovered.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

int — a value of this type

(&Select) needs_paint

XuAPI
pub fn (sel &Select) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

($&Select) painted

XuAPI
pub fn (sel $&Select) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Select) invalidate

XuAPI
pub fn (sel $&Select) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Select) cancel

XuAPI
pub fn (sel $&Select) cancel()

Purpose

Execute cancel on $&Select.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Select) is_enabled

XuAPI
pub fn (sel &Select) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

($&Select) set_enabled

XuAPI
pub fn (sel $&Select) set_enabled(enabled bool)

Purpose

Operation on $&Select: set enabled.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Select) is_focused

XuAPI
pub fn (sel &Select) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

($&Select) set_focus

XuAPI
pub fn (sel $&Select) set_focus(focused bool)

Purpose

Operation on $&Select: set focus.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

(&Select) is_hovered

XuAPI
pub fn (sel &Select) is_hovered() bool

Purpose

Operation on &Select: whether it is hovered.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

(&Select) is_invalid

XuAPI
pub fn (sel &Select) is_invalid() bool

Purpose

Operation on &Select: whether it is invalid.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

($&Select) set_invalid

XuAPI
pub fn (sel $&Select) set_invalid(invalid bool)

Purpose

Operation on $&Select: set invalid.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Select) is_read_only

XuAPI
pub fn (sel &Select) is_read_only() bool

Purpose

Operation on &Select: whether it is read only.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

($&Select) set_read_only

XuAPI
pub fn (sel $&Select) set_read_only(read_only bool)

Purpose

Operation on $&Select: set read only.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

($&Select) set_open

XuAPI
pub fn (sel $&Select) set_open(open bool)

Purpose

Operation on $&Select: set open.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
open bool
open (bool)

Returns

This call does not return a value.

($&Select) set_count

XuAPI
pub fn (sel $&Select) set_count(count int) int

Purpose

Operation on $&Select: set count. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
count int
count (int)

Returns

int — a value of this type

($&Select) set_selected

XuAPI
pub fn (sel $&Select) set_selected(index int) int

Purpose

Operation on $&Select: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&Select) set_bounds

XuAPI
pub fn (sel $&Select) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Select: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Select) visual_state

XuAPI
pub fn (sel &Select) visual_state() int

Purpose

Operation on &Select: visual state.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

int — a value of this type

(&Select) has_style

XuAPI
pub fn (sel &Select) has_style() bool

Purpose

Operation on &Select: whether it has style.

Parameters

sel &Select
The Select instance used by this call (borrow).

Returns

bool — true or false

(&Select) style_or

XuAPI
pub fn (sel &Select) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Select: style or.

Parameters

sel &Select
The Select instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Select) set_style

XuAPI
pub fn (sel $&Select) set_style(style &ControlStyle) int

Purpose

Operation on $&Select: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Select) clear_style

XuAPI
pub fn (sel $&Select) clear_style()

Purpose

Operation on $&Select: clear style.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Select) popup_bounds

XuAPI
pub fn (sel &Select) popup_bounds(styles &Styles) layout.Rect

Purpose

Operation on &Select: popup bounds.

Parameters

sel &Select
The Select instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Rect — a value of this type

($&Select) set_popup_above

XuAPI
pub fn (sel $&Select) set_popup_above(above bool)

Purpose

Operation on $&Select: set popup above.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
above bool
above (bool)

Returns

This call does not return a value.

($&Select) apply_styles

XuAPI
pub fn (sel $&Select) apply_styles(styles &Styles) int

Purpose

Keep the input geometry synchronized with popup_bounds/option_bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Select) option_bounds

XuAPI
pub fn (sel &Select) option_bounds(index int,styles &Styles) layout.Rect

Purpose

Operation on &Select: option bounds.

Parameters

sel &Select
The Select instance used by this call (borrow).
index int
index (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Rect — a value of this type

($&Select) input

XuAPI
pub fn (sel $&Select) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Select) event

XuAPI
pub fn (sel $&Select) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Select) paint

XuAPI
pub fn (sel &Select) paint(frame $&draw.Frame,labels &[]draw.TextLayout,theme &Theme) int

Purpose

Paint the control visually onto the target canvas. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel &Select
The Select instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
labels &[]draw.TextLayout
labels (read-only borrow; caller keeps the original; type &[]draw.TextLayout)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

(&Select) measure_styled

XuAPI
pub fn (sel &Select) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Operation on &Select: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel &Select
The Select instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Select) paint_styled

XuAPI
pub fn (sel &Select) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Select: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel &Select
The Select instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Select) paint_popup_box_styled

XuAPI
pub fn (sel &Select) paint_popup_box_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on &Select: paint popup box styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel &Select
The Select instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Select) paint_option_styled

XuAPI
pub fn (sel &Select) paint_option_styled(frame $&draw.Frame,index int,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Select: paint option styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel &Select
The Select instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
index int
index (int)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Select) paint_popup_styled

XuAPI
pub fn (sel &Select) paint_popup_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Select: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel &Select
The Select instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Select) set_option_enabled

XuAPI
pub fn (sel $&Select) set_option_enabled(index int,enabled bool) int

Purpose

Operation on $&Select: set option enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
index int
index (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Select) set_popup_rows

XuAPI
pub fn (sel $&Select) set_popup_rows(rows int) int

Purpose

Operation on $&Select: set popup rows. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
rows int
rows (int)

Returns

int — a value of this type

(&Tabs) is_automatic

XuAPI
pub fn (t &Tabs) is_automatic() bool

Purpose

Operation on &Tabs: whether it is automatic.

Parameters

t &Tabs
The Tabs instance used by this call (borrow).

Returns

bool — true or false

struct DatePicker

XuAPI
pub struct DatePicker {

}

Purpose

A date field with an overlay calendar. Time and nanoseconds are preserved dates are interpreted in UTC, matching time.Time's calendar accessors.

Public fields

This type has no public fields.

date_picker

XuAPI
pub fn date_picker(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value time.Time) DatePicker

Purpose

Date picker. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value time.Time
value (time.Time)

Returns

DatePicker — a value of this type

(&DatePicker) id

XuAPI
pub fn (picker &DatePicker) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

int — a value of this type

(&DatePicker) bounds

XuAPI
pub fn (picker &DatePicker) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&DatePicker) value

XuAPI
pub fn (picker &DatePicker) value() time.Time

Purpose

Execute value on &DatePicker.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

time.Time — a value of this type

(&DatePicker) is_open

XuAPI
pub fn (picker &DatePicker) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

bool — true or false

(&DatePicker) is_selectable

XuAPI
pub fn (picker &DatePicker) is_selectable() bool

Purpose

Operation on &DatePicker: whether it is selectable.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

bool — true or false

($&DatePicker) set_selectable

XuAPI
pub fn (picker $&DatePicker) set_selectable(selectable bool)

Purpose

Operation on $&DatePicker: set selectable.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&DatePicker) needs_paint

XuAPI
pub fn (picker &DatePicker) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

bool — true or false

(&DatePicker) visual_state

XuAPI
pub fn (picker &DatePicker) visual_state() int

Purpose

Operation on &DatePicker: visual state.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

int — a value of this type

(&DatePicker) style_or

XuAPI
pub fn (picker &DatePicker) style_or(styles &Styles) ControlStyle

Purpose

Operation on &DatePicker: style or.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&DatePicker) set_style

XuAPI
pub fn (picker $&DatePicker) set_style(style &ControlStyle) int

Purpose

Operation on $&DatePicker: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&DatePicker) set_enabled

XuAPI
pub fn (picker $&DatePicker) set_enabled(enabled bool)

Purpose

Operation on $&DatePicker: set enabled.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&DatePicker) set_read_only

XuAPI
pub fn (picker $&DatePicker) set_read_only(read_only bool) int

Purpose

Operation on $&DatePicker: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&DatePicker) set_invalid

XuAPI
pub fn (picker $&DatePicker) set_invalid(invalid bool)

Purpose

Operation on $&DatePicker: set invalid.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&DatePicker) set_focus

XuAPI
pub fn (picker $&DatePicker) set_focus(focused bool)

Purpose

Operation on $&DatePicker: set focus.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&DatePicker) set_bounds

XuAPI
pub fn (picker $&DatePicker) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&DatePicker: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&DatePicker) set_value

XuAPI
pub fn (picker $&DatePicker) set_value(value time.Time) int

Purpose

Operation on $&DatePicker: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
value time.Time
value (time.Time)

Returns

int — a value of this type

($&DatePicker) set_range

XuAPI
pub fn (picker $&DatePicker) set_range(minimum time.Time,maximum time.Time) int

Purpose

Operation on $&DatePicker: set range. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
minimum time.Time
minimum (time.Time)
maximum time.Time
maximum (time.Time)

Returns

int — a value of this type

($&DatePicker) set_open

XuAPI
pub fn (picker $&DatePicker) set_open(open bool)

Purpose

Operation on $&DatePicker: set open.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
open bool
open (bool)

Returns

This call does not return a value.

($&DatePicker) set_popup_above

XuAPI
pub fn (picker $&DatePicker) set_popup_above(above bool)

Purpose

Operation on $&DatePicker: set popup above.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
above bool
above (bool)

Returns

This call does not return a value.

($&DatePicker) apply_styles

XuAPI
pub fn (picker $&DatePicker) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&DatePicker) popup_bounds

XuAPI
pub fn (picker &DatePicker) popup_bounds() layout.Rect

Purpose

Operation on &DatePicker: popup bounds.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&DatePicker) calendar_cell

XuAPI
pub fn (picker &DatePicker) calendar_cell(index int) layout.Rect

Purpose

0..41 follow the configured first weekday; 42/43 are previous/next month. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

(&DatePicker) calendar_date

XuAPI
pub fn (picker &DatePicker) calendar_date(index int) time.Time

Purpose

Operation on &DatePicker: calendar date. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).
index int
index (int)

Returns

time.Time — a value of this type

($&DatePicker) input

XuAPI
pub fn (picker $&DatePicker) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&DatePicker) route

XuAPI
pub fn (picker $&DatePicker) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&DatePicker) measure_styled

XuAPI
pub fn (picker $&DatePicker) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&DatePicker: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&DatePicker) paint_styled

XuAPI
pub fn (picker $&DatePicker) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&DatePicker: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&DatePicker) paint_popup_styled

XuAPI
pub fn (picker $&DatePicker) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&DatePicker: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&DatePicker) dispose

XuAPI
pub fn (picker $&DatePicker) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&DatePicker) has_value

XuAPI
pub fn (picker &DatePicker) has_value() bool

Purpose

Operation on &DatePicker: whether it has value.

Parameters

picker &DatePicker
The DatePicker instance used by this call (borrow).

Returns

bool — true or false

($&DatePicker) set_clearable

XuAPI
pub fn (picker $&DatePicker) set_clearable(enabled bool)

Purpose

Operation on $&DatePicker: set clearable.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&DatePicker) clear

XuAPI
pub fn (picker $&DatePicker) clear() int

Purpose

Clear all buffered or stored entries and internal state. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&DatePicker) set_today

XuAPI
pub fn (picker $&DatePicker) set_today(today time.Time) int

Purpose

The application supplies today in its intended timezone. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&DatePicker
The DatePicker instance used by this call (exclusive borrow).
today time.Time
today (time.Time)

Returns

int — a value of this type

const ACTION_SUBMIT

XuAPI
pub const ACTION_SUBMIT = 4

Purpose

Constant ACTION_SUBMIT, defining protocol or algorithm parameters.

See usage example

struct Editor

XuAPI
pub struct Editor {

}

Purpose

Input and TextArea share one persistent editor. Native TextInput owns edits while focused; this model owns the committed value between focus lifetimes.

Public fields

This type has no public fields.

See usage example

input

XuAPI
pub fn input(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value &string) Editor

Purpose

Create a persistent single-line Editor. Text is at most 16384 UTF-8 bytes without NUL; Context must match the window identity.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

an owned Editor; dispose on closure

See usage example

text_area

XuAPI
pub fn text_area(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value &string) Editor

Purpose

Create a persistent multiline Editor. Text is at most 16384 UTF-8 bytes without NUL; Context must match the window identity.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

an owned Editor; dispose on closure

See usage example

(&Editor) id

XuAPI
pub fn (editor &Editor) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

int — a value of this type

(&Editor) value

XuAPI
pub fn (editor &Editor) value() string

Purpose

Execute value on &Editor.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

string — result string

(&Editor) has_selection

XuAPI
pub fn (editor &Editor) has_selection() bool

Purpose

Operation on &Editor: whether it has selection.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) selection_range

XuAPI
pub fn (editor &Editor) selection_range() TextRange

Purpose

Operation on &Editor: selection range.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

TextRange — a value of this type

(&Editor) selected_text

XuAPI
pub fn (editor &Editor) selected_text() string

Purpose

Operation on &Editor: selected text.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

string — result string

(&Editor) is_password

XuAPI
pub fn (editor &Editor) is_password() bool

Purpose

Operation on &Editor: whether it is password.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) is_password_visible

XuAPI
pub fn (editor &Editor) is_password_visible() bool

Purpose

Operation on &Editor: whether it is password visible.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

($&Editor) set_password

XuAPI
pub fn (editor $&Editor) set_password(on bool) int

Purpose

Operation on $&Editor: set password. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

int — a value of this type

($&Editor) set_password_visible

XuAPI
pub fn (editor $&Editor) set_password_visible(visible bool) int

Purpose

Operation on $&Editor: set password visible. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
visible bool
visible (bool)

Returns

int — a value of this type

(&Editor) is_focused

XuAPI
pub fn (editor &Editor) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) is_enabled

XuAPI
pub fn (editor &Editor) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) is_selectable

XuAPI
pub fn (editor &Editor) is_selectable() bool

Purpose

Operation on &Editor: whether it is selectable.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) has_popup_open

XuAPI
pub fn (editor &Editor) has_popup_open() bool

Purpose

Operation on &Editor: whether it has popup open.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) popup_bounds

XuAPI
pub fn (editor &Editor) popup_bounds() layout.Rect

Purpose

Operation on &Editor: popup bounds.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Editor) cursor

XuAPI
pub fn (editor &Editor) cursor() int

Purpose

Execute cursor on &Editor.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

int — a value of this type

(&Editor) needs_paint

XuAPI
pub fn (editor &Editor) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

($&Editor) painted

XuAPI
pub fn (editor $&Editor) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Editor) set_locale

XuAPI
pub fn (editor $&Editor) set_locale(locale &Locale) int

Purpose

Operation on $&Editor: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Editor) set_viewport

XuAPI
pub fn (editor $&Editor) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&Editor: set viewport.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&Editor) set_selectable

XuAPI
pub fn (editor $&Editor) set_selectable(selectable bool) int

Purpose

Operation on $&Editor: set selectable. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

int — a value of this type

($&Editor) paint_popup_styled

XuAPI
pub fn (editor $&Editor) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Editor: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Editor) set_placeholder

XuAPI
pub fn (editor $&Editor) set_placeholder(value &string) int

Purpose

Operation on $&Editor: set placeholder. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&Editor) focus_session

XuAPI
pub fn (editor $&Editor) focus_session(on bool) int

Purpose

Change editing focus and native session lifetime; committed text persists on blur.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

0 on success; throws on failure

($&Editor) enable

XuAPI
pub fn (editor $&Editor) enable(on bool) int

Purpose

Execute enable on $&Editor. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

int — a value of this type

($&Editor) place

XuAPI
pub fn (editor $&Editor) place(bounds &layout.Rect) int

Purpose

Set canvas-global bounds after layout or ancestor scrolling to synchronize native IME geometry.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

0 on success; throws on failure

place_editor

XuAPI
pub fn place_editor(view $&View,editor $&Editor) int

Purpose

Get canvas-global editor bounds from View, synchronize IME, enable outside capture and propagate dirty state.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
editor $&Editor
editor (exclusive borrow; may modify the original; type $&Editor)

Returns

0 on success; throws on failure

See usage example

($&Editor) set_value

XuAPI
pub fn (editor $&Editor) set_value(value &string) int

Purpose

Operation on $&Editor: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&Editor) route

XuAPI
pub fn (editor $&Editor) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Editor) event

XuAPI
pub fn (editor $&Editor) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Editor) paint

XuAPI
pub fn (editor $&Editor) paint(frame $&draw.Frame,theme &Theme) int

Purpose

Retain the layout until the containing frame has been accepted. painted acknowledges dirtiness, not native resource ownership. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
theme &Theme
theme (read-only borrow; caller keeps the original; type &Theme)

Returns

int — a value of this type

($&Editor) dispose

XuAPI
pub fn (editor $&Editor) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Editor) caret_opacity

XuAPI
pub fn (editor &Editor) caret_opacity() f64

Purpose

Operation on &Editor: caret opacity.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

f64 — a value of this type

(&Editor) has_caret_animation

XuAPI
pub fn (editor &Editor) has_caret_animation() bool

Purpose

Operation on &Editor: whether it has caret animation.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) next_caret_tick

XuAPI
pub fn (editor &Editor) next_caret_tick(now time.Instant,reduced_motion bool) time.Instant

Purpose

Operation on &Editor: next caret tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor &Editor
The Editor instance used by this call (borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

time.Instant — a value of this type

($&Editor) tick

XuAPI
pub fn (editor $&Editor) tick(now time.Instant,reduced_motion bool) bool

Purpose

Call from the owning event loop. Only the short fade phases need new frames editing/selection restarts a full visible interval and IME stays steady. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

(&Editor) bounds

XuAPI
pub fn (editor &Editor) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Editor) is_invalid

XuAPI
pub fn (editor &Editor) is_invalid() bool

Purpose

Operation on &Editor: whether it is invalid.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) is_hovered

XuAPI
pub fn (editor &Editor) is_hovered() bool

Purpose

Operation on &Editor: whether it is hovered.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) visual_state

XuAPI
pub fn (editor &Editor) visual_state() int

Purpose

Operation on &Editor: visual state.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

int — a value of this type

(&Editor) has_style

XuAPI
pub fn (editor &Editor) has_style() bool

Purpose

Operation on &Editor: whether it has style.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

(&Editor) style_or

XuAPI
pub fn (editor &Editor) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Editor: style or.

Parameters

editor &Editor
The Editor instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Editor) set_style

XuAPI
pub fn (editor $&Editor) set_style(style &ControlStyle) int

Purpose

Operation on $&Editor: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Editor) clear_style

XuAPI
pub fn (editor $&Editor) clear_style()

Purpose

Operation on $&Editor: clear style.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Editor) apply_styles

XuAPI
pub fn (editor $&Editor) apply_styles(styles &Styles) int

Purpose

Validate and apply styles, updating layout / geometry and repainting when metrics change.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

($&Editor) paint_motion_styled

XuAPI
pub fn (editor $&Editor) paint_motion_styled(frame $&draw.Frame,styles &Styles,motion $&PaintTransition,now time.Instant,reduced_motion bool) int

Purpose

Operation on $&Editor: paint motion styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
motion $&PaintTransition
motion (exclusive borrow; may modify the original; type $&PaintTransition)
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

int — a value of this type

($&Editor) set_invalid

XuAPI
pub fn (editor $&Editor) set_invalid(invalid bool)

Purpose

Operation on $&Editor: set invalid.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Editor) is_read_only

XuAPI
pub fn (editor &Editor) is_read_only() bool

Purpose

Operation on &Editor: whether it is read only.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

($&Editor) set_read_only

XuAPI
pub fn (editor $&Editor) set_read_only(on bool) int

Purpose

Switch read-only state, releasing or restarting native input. Preserve selection, navigation and copy; reject edits and late IME commits while read-only.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

0 on success; throws on failure

(&Editor) is_copy_enabled

XuAPI
pub fn (editor &Editor) is_copy_enabled() bool

Purpose

Operation on &Editor: whether it is copy enabled.

Parameters

editor &Editor
The Editor instance used by this call (borrow).

Returns

bool — true or false

($&Editor) set_copy_enabled

XuAPI
pub fn (editor $&Editor) set_copy_enabled(on bool)

Purpose

Operation on $&Editor: set copy enabled.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

This call does not return a value.

($&Editor) measure_styled

XuAPI
pub fn (editor $&Editor) measure_styled(styles &Styles) layout.Size

Purpose

Measure Editor with the effective font, density, content and minimum size.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

intrinsic logical size; throws if native shaping fails

($&Editor) paint_styled

XuAPI
pub fn (editor $&Editor) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint Editor using the complete theme; control bounds and Frame use the same local coordinates.

Parameters

editor $&Editor
The Editor instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

const FIELD_OUTLINED

XuAPI
pub const FIELD_OUTLINED = 0

Purpose

Constant FIELD_OUTLINED, defining protocol or algorithm parameters.

const FIELD_FILLED

XuAPI
pub const FIELD_FILLED = 1

Purpose

Constant FIELD_FILLED, defining protocol or algorithm parameters.

const FIELD_UNDERLINED

XuAPI
pub const FIELD_UNDERLINED = 2

Purpose

Constant FIELD_UNDERLINED, defining protocol or algorithm parameters.

const LABEL_AUTO

XuAPI
pub const LABEL_AUTO = 0

Purpose

Constant LABEL_AUTO, defining protocol or algorithm parameters.

const LABEL_ALWAYS

XuAPI
pub const LABEL_ALWAYS = 1

Purpose

Constant LABEL_ALWAYS, defining protocol or algorithm parameters.

See usage example

const LABEL_NEVER

XuAPI
pub const LABEL_NEVER = 2

Purpose

Constant LABEL_NEVER, defining protocol or algorithm parameters.

const LABEL_STATIC

XuAPI
pub const LABEL_STATIC = 3

Purpose

Constant LABEL_STATIC, defining protocol or algorithm parameters.

struct FieldDecoration

XuAPI
pub struct FieldDecoration {
    pub label string
    pub helper string
    pub error string
    pub prefix string
    pub suffix string
    pub variant int
    pub floating int
    pub clearable bool
    pub reserve_helper bool
}

Purpose

Structure encapsulating label, helper, error, prefix, suffix.

Public fields

label string
field (string)
helper string
field (string)
error string
field (string)
prefix string
prefix
suffix string
suffix
variant int
field (int)
floating int
field (int)
clearable bool
field (bool)
reserve_helper bool
field (bool)

field_decoration

XuAPI
pub fn field_decoration(label &string) FieldDecoration

Purpose

Field decoration.

Parameters

label &string
label (read-only borrow; caller keeps the original; type &string)

Returns

FieldDecoration — a value of this type

See usage example

(&FieldDecoration) validate

XuAPI
pub fn (d &FieldDecoration) validate() int

Purpose

Execute validate on &FieldDecoration. Throws on failure; handle the error or propagate it to the caller.

Parameters

d &FieldDecoration
The FieldDecoration instance used by this call (borrow).

Returns

int — a value of this type

struct Field

XuAPI
pub struct Field {

}

Purpose

The decorator owns an ordinary Editor. Its content geometry is independent of label animation, preserving selection, native IME and candidate placement.

Public fields

This type has no public fields.

field

XuAPI
pub fn field(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value &string,decoration &FieldDecoration) Field

Purpose

Execute field. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value &string
value (read-only borrow; caller keeps the original; type &string)
decoration &FieldDecoration
decoration (read-only borrow; caller keeps the original; type &FieldDecoration)

Returns

Field — a value of this type

text_field_area

XuAPI
pub fn text_field_area(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value &string,decoration &FieldDecoration) Field

Purpose

Text field area. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value &string
value (read-only borrow; caller keeps the original; type &string)
decoration &FieldDecoration
decoration (read-only borrow; caller keeps the original; type &FieldDecoration)

Returns

Field — a value of this type

(&Field) id

XuAPI
pub fn (f &Field) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

int — a value of this type

(&Field) bounds

XuAPI
pub fn (f &Field) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Field) value

XuAPI
pub fn (f &Field) value() string

Purpose

Execute value on &Field.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

string — result string

(&Field) has_selection

XuAPI
pub fn (f &Field) has_selection() bool

Purpose

Operation on &Field: whether it has selection.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) is_copy_enabled

XuAPI
pub fn (f &Field) is_copy_enabled() bool

Purpose

Operation on &Field: whether it is copy enabled.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) selected_text

XuAPI
pub fn (f &Field) selected_text() string

Purpose

Operation on &Field: selected text.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

string — result string

(&Field) is_enabled

XuAPI
pub fn (f &Field) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) is_focused

XuAPI
pub fn (f &Field) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) is_read_only

XuAPI
pub fn (f &Field) is_read_only() bool

Purpose

Operation on &Field: whether it is read only.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) is_invalid

XuAPI
pub fn (f &Field) is_invalid() bool

Purpose

Operation on &Field: whether it is invalid.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) is_selectable

XuAPI
pub fn (f &Field) is_selectable() bool

Purpose

Operation on &Field: whether it is selectable.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) cursor

XuAPI
pub fn (f &Field) cursor() int

Purpose

Execute cursor on &Field.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

int — a value of this type

(&Field) has_popup_open

XuAPI
pub fn (f &Field) has_popup_open() bool

Purpose

Operation on &Field: whether it has popup open.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) popup_bounds

XuAPI
pub fn (f &Field) popup_bounds() layout.Rect

Purpose

Operation on &Field: popup bounds.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Field) needs_paint

XuAPI
pub fn (f &Field) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

($&Field) painted

XuAPI
pub fn (f $&Field) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Field) style_or

XuAPI
pub fn (f &Field) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Field: style or.

Parameters

f &Field
The Field instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Field) set_style

XuAPI
pub fn (f $&Field) set_style(style &ControlStyle) int

Purpose

Operation on $&Field: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Field) set_decoration

XuAPI
pub fn (f $&Field) set_decoration(decoration &FieldDecoration) int

Purpose

Operation on $&Field: set decoration. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
decoration &FieldDecoration
decoration (read-only borrow; caller keeps the original; type &FieldDecoration)

Returns

int — a value of this type

($&Field) set_motion

XuAPI
pub fn (f $&Field) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Field: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Field) set_invalid

XuAPI
pub fn (f $&Field) set_invalid(invalid bool)

Purpose

Operation on $&Field: set invalid.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&Field) set_value

XuAPI
pub fn (f $&Field) set_value(value &string) int

Purpose

Operation on $&Field: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&Field) set_read_only

XuAPI
pub fn (f $&Field) set_read_only(read_only bool) int

Purpose

Operation on $&Field: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&Field) set_selectable

XuAPI
pub fn (f $&Field) set_selectable(selectable bool) int

Purpose

Operation on $&Field: set selectable. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

int — a value of this type

($&Field) set_copy_enabled

XuAPI
pub fn (f $&Field) set_copy_enabled(on bool)

Purpose

Operation on $&Field: set copy enabled.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

This call does not return a value.

($&Field) set_viewport

XuAPI
pub fn (f $&Field) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&Field: set viewport.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&Field) paint_popup_styled

XuAPI
pub fn (f $&Field) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Field: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Field) focus_session

XuAPI
pub fn (f $&Field) focus_session(focused bool) int

Purpose

Operation on $&Field: focus session. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

int — a value of this type

($&Field) enable

XuAPI
pub fn (f $&Field) enable(enabled bool) int

Purpose

Execute enable on $&Field. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Field) place

XuAPI
pub fn (f $&Field) place(bounds &layout.Rect) int

Purpose

Compute and place control bounds within canvas layout. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Field) apply_styles

XuAPI
pub fn (f $&Field) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Field) input

XuAPI
pub fn (f $&Field) input(input &ui.InputEvent) Action

Purpose

Like Editor.route, pointer coordinates are local to bounds; input offers the canvas-coordinate entry point used by Screen and immediate applications. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Field) route

XuAPI
pub fn (f $&Field) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Field) event

XuAPI
pub fn (f $&Field) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Field) tick

XuAPI
pub fn (f $&Field) tick(now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&Field) next_caret_tick

XuAPI
pub fn (f &Field) next_caret_tick(now time.Instant,reduced bool) time.Instant

Purpose

Operation on &Field: next caret tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

f &Field
The Field instance used by this call (borrow).
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

time.Instant — a value of this type

($&Field) measure_styled

XuAPI
pub fn (f $&Field) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&Field: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&Field) dispose

XuAPI
pub fn (f $&Field) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Field) paint_styled

XuAPI
pub fn (f $&Field) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint in local coordinates, matching Editor and View. The Editor still retains its canvas-global bounds for the native text session. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct FieldTextOptions

XuAPI
pub struct FieldTextOptions {
    pub min_rows int
    pub max_rows int
    pub counter bool
    pub character_limit int
}

Purpose

Widgets Configuration parameters and options set.

Public fields

min_rows int
field (int)
max_rows int
field (int)
counter bool
field (bool)
character_limit int
field (int)

field_text_options

XuAPI
pub fn field_text_options() FieldTextOptions

Purpose

Field text options.

Parameters

No arguments are required.

Returns

FieldTextOptions — a value of this type

See usage example

(&FieldTextOptions) validate

XuAPI
pub fn (options &FieldTextOptions) validate() int

Purpose

Execute validate on &FieldTextOptions. Throws on failure; handle the error or propagate it to the caller.

Parameters

options &FieldTextOptions
The FieldTextOptions instance used by this call (borrow).

Returns

int — a value of this type

($&Field) set_text_options

XuAPI
pub fn (f $&Field) set_text_options(options &FieldTextOptions) int

Purpose

Operation on $&Field: set text options. Throws on failure; handle the error or propagate it to the caller.

Parameters

f $&Field
The Field instance used by this call (exclusive borrow).
options &FieldTextOptions
options (read-only borrow; caller keeps the original; type &FieldTextOptions)

Returns

int — a value of this type

(&Field) text_options

XuAPI
pub fn (f &Field) text_options() FieldTextOptions

Purpose

Operation on &Field: text options.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

FieldTextOptions — a value of this type

(&Field) character_count

XuAPI
pub fn (f &Field) character_count() int

Purpose

Counts Unicode scalars without truncating text or touching IME composition. This is a soft counter; application validation decides when to reject input.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

int — a value of this type

(&Field) is_over_limit

XuAPI
pub fn (f &Field) is_over_limit() bool

Purpose

Operation on &Field: whether it is over limit.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

bool — true or false

(&Field) preferred_rows

XuAPI
pub fn (f &Field) preferred_rows() int

Purpose

Operation on &Field: preferred rows.

Parameters

f &Field
The Field instance used by this call (borrow).

Returns

int — a value of this type

($&StyledLabel) paint_ellipsized_styled

XuAPI
pub fn (label $&StyledLabel) paint_ellipsized_styled(frame $&draw.Frame,bounds &layout.Rect,styles &Styles,fallback &ControlStyle,state int) int

Purpose

End ellipsis uses shaped cluster boundaries. The label retains its full text callers can associate a Tooltip or render the full wrapped text on demand. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)

Returns

int — a value of this type

($&Screen) set_label_ellipsis

XuAPI
pub fn (s $&Screen) set_label_ellipsis(id int,enabled bool) int

Purpose

Operation on $&Screen: set label ellipsis. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

struct ListAppearance

XuAPI
pub struct ListAppearance {
    pub row_height f64
    pub leading_size f64
    pub gap f64
    pub detail_width f64
    pub secondary bool
}

Purpose

Structure encapsulating row_height, leading_size, gap, detail_width, secondary.

Public fields

row_height f64
field (f64)
leading_size f64
field (f64)
gap f64
field (f64)
detail_width f64
field (f64)
secondary bool
field (bool)

list_appearance

XuAPI
pub fn list_appearance() ListAppearance

Purpose

List appearance.

Parameters

No arguments are required.

Returns

ListAppearance — a value of this type

(&ListAppearance) validate

XuAPI
pub fn (appearance &ListAppearance) validate() int

Purpose

Execute validate on &ListAppearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

appearance &ListAppearance
The ListAppearance instance used by this call (borrow).

Returns

int — a value of this type

($&ListBox) set_appearance

XuAPI
pub fn (lb $&ListBox) set_appearance(appearance &ListAppearance) int

Purpose

Operation on $&ListBox: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
appearance &ListAppearance
appearance (read-only borrow; caller keeps the original; type &ListAppearance)

Returns

int — a value of this type

(&ListBox) item_bounds

XuAPI
pub fn (lb &ListBox) item_bounds(index int,styles &Styles) layout.Rect

Purpose

Operation on &ListBox: item bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
index int
index (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Rect — a value of this type

struct ListRow

XuAPI
pub struct ListRow {
    pub title string
    pub description string
    pub detail string
    pub icon int
}

Purpose

Structure encapsulating title, description, detail, icon.

Public fields

title string
field (string)
description string
field (string)
detail string
field (string)
icon int
field (int)

list_row

XuAPI
pub fn list_row(title string) ListRow

Purpose

List row.

Parameters

title string
title (string)

Returns

ListRow — a value of this type

See usage example

(&ListRow) validate

XuAPI
pub fn (row &ListRow) validate() int

Purpose

Execute validate on &ListRow. Throws on failure; handle the error or propagate it to the caller.

Parameters

row &ListRow
The ListRow instance used by this call (borrow).

Returns

int — a value of this type

(&ListBox) hit_item_byte

XuAPI
pub fn (lb &ListBox) hit_item_byte(index int,title $&StyledLabel,styles &Styles,has_row_layout bool,has_description bool,has_detail bool,icon int,x_pos f64,y_pos f64) int

Purpose

Operation on &ListBox: hit item byte.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
index int
index (int)
title $&StyledLabel
title (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
has_row_layout bool
has_row_layout (bool)
has_description bool
has_description (bool)
has_detail bool
has_detail (bool)
icon int
icon (int)
x_pos f64
x_pos (f64)
y_pos f64
y_pos (f64)

Returns

int — a value of this type

(&ListBox) paint_row_styled

XuAPI
pub fn (lb &ListBox) paint_row_styled(frame $&draw.Frame,index int,title $&StyledLabel,description $&StyledLabel,detail $&StyledLabel,icon int,styles &Styles) int

Purpose

Operation on &ListBox: paint row styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb &ListBox
The ListBox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
index int
index (int)
title $&StyledLabel
title (exclusive borrow; may modify the original; type $&StyledLabel)
description $&StyledLabel
description (exclusive borrow; may modify the original; type $&StyledLabel)
detail $&StyledLabel
detail (exclusive borrow; may modify the original; type $&StyledLabel)
icon int
icon (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Screen) set_list_row

XuAPI
pub fn (s $&Screen) set_list_row(id int,index int,row &ListRow) int

Purpose

Operation on $&Screen: set list row. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
index int
index (int)
row &ListRow
row (read-only borrow; caller keeps the original; type &ListRow)

Returns

int — a value of this type

struct Locale

XuAPI
pub struct Locale {

}

Purpose

Component-owned copy and display conventions. Application text and data stay untouched.

Public fields

This type has no public fields.

const TEXT_DATE_PLACEHOLDER

XuAPI
pub const TEXT_DATE_PLACEHOLDER = 0

Purpose

Constant TEXT_DATE_PLACEHOLDER, defining protocol or algorithm parameters.

See usage example

const TEXT_TODAY

XuAPI
pub const TEXT_TODAY = 1

Purpose

Constant TEXT_TODAY, defining protocol or algorithm parameters.

See usage example

const TEXT_CLEAR

XuAPI
pub const TEXT_CLEAR = 2

Purpose

Constant TEXT_CLEAR, defining protocol or algorithm parameters.

See usage example

const TEXT_NO_OPTIONS

XuAPI
pub const TEXT_NO_OPTIONS = 3

Purpose

Constant TEXT_NO_OPTIONS, defining protocol or algorithm parameters.

const TEXT_NO_MATCHES

XuAPI
pub const TEXT_NO_MATCHES = 4

Purpose

Constant TEXT_NO_MATCHES, defining protocol or algorithm parameters.

const TEXT_CHOOSE_OPTIONS

XuAPI
pub const TEXT_CHOOSE_OPTIONS = 5

Purpose

Constant TEXT_CHOOSE_OPTIONS, defining protocol or algorithm parameters.

const TEXT_SELECTED_COUNT

XuAPI
pub const TEXT_SELECTED_COUNT = 6

Purpose

Constant TEXT_SELECTED_COUNT, defining protocol or algorithm parameters.

const TEXT_NO_RECORDS

XuAPI
pub const TEXT_NO_RECORDS = 7

Purpose

Constant TEXT_NO_RECORDS, defining protocol or algorithm parameters.

const TEXT_TASK_WORKING

XuAPI
pub const TEXT_TASK_WORKING = 8

Purpose

Constant TEXT_TASK_WORKING, defining protocol or algorithm parameters.

const TEXT_TASK_DONE

XuAPI
pub const TEXT_TASK_DONE = 9

Purpose

Constant TEXT_TASK_DONE, defining protocol or algorithm parameters.

const TEXT_TASK_RETRY

XuAPI
pub const TEXT_TASK_RETRY = 10

Purpose

Constant TEXT_TASK_RETRY, defining protocol or algorithm parameters.

const TEXT_TASK_CANCELLING

XuAPI
pub const TEXT_TASK_CANCELLING = 11

Purpose

Constant TEXT_TASK_CANCELLING, defining protocol or algorithm parameters.

const TEXT_WEB_CONTENT

XuAPI
pub const TEXT_WEB_CONTENT = 12

Purpose

Constant TEXT_WEB_CONTENT, defining protocol or algorithm parameters.

const TEXT_WEB_LOADING

XuAPI
pub const TEXT_WEB_LOADING = 13

Purpose

Constant TEXT_WEB_LOADING, defining protocol or algorithm parameters.

const TEXT_WEB_UNAVAILABLE

XuAPI
pub const TEXT_WEB_UNAVAILABLE = 14

Purpose

Constant TEXT_WEB_UNAVAILABLE, defining protocol or algorithm parameters.

const TEXT_WEB_FAILED

XuAPI
pub const TEXT_WEB_FAILED = 15

Purpose

Constant TEXT_WEB_FAILED, defining protocol or algorithm parameters.

const TEXT_AM

XuAPI
pub const TEXT_AM = 16

Purpose

Constant TEXT_AM, defining protocol or algorithm parameters.

const TEXT_PM

XuAPI
pub const TEXT_PM = 17

Purpose

Constant TEXT_PM, defining protocol or algorithm parameters.

const TEXT_DATE_PATTERN

XuAPI
pub const TEXT_DATE_PATTERN = 18

Purpose

Constant TEXT_DATE_PATTERN, defining protocol or algorithm parameters.

See usage example

const TEXT_CALENDAR_PATTERN

XuAPI
pub const TEXT_CALENDAR_PATTERN = 19

Purpose

Constant TEXT_CALENDAR_PATTERN, defining protocol or algorithm parameters.

const TEXT_DECIMAL_SEPARATOR

XuAPI
pub const TEXT_DECIMAL_SEPARATOR = 20

Purpose

Constant TEXT_DECIMAL_SEPARATOR, defining protocol or algorithm parameters.

See usage example

const TEXT_GROUP_SEPARATOR

XuAPI
pub const TEXT_GROUP_SEPARATOR = 21

Purpose

Constant TEXT_GROUP_SEPARATOR, defining protocol or algorithm parameters.

See usage example

const TEXT_PERCENT_PATTERN

XuAPI
pub const TEXT_PERCENT_PATTERN = 22

Purpose

Constant TEXT_PERCENT_PATTERN, defining protocol or algorithm parameters.

const TEXT_OVERFLOW_PATTERN

XuAPI
pub const TEXT_OVERFLOW_PATTERN = 23

Purpose

Constant TEXT_OVERFLOW_PATTERN, defining protocol or algorithm parameters.

const TEXT_COUNTER_PATTERN

XuAPI
pub const TEXT_COUNTER_PATTERN = 24

Purpose

Constant TEXT_COUNTER_PATTERN, defining protocol or algorithm parameters.

const TEXT_TIME_SEPARATOR

XuAPI
pub const TEXT_TIME_SEPARATOR = 25

Purpose

Constant TEXT_TIME_SEPARATOR, defining protocol or algorithm parameters.

const TEXT_RED

XuAPI
pub const TEXT_RED = 26

Purpose

Constant TEXT_RED, defining protocol or algorithm parameters.

const TEXT_GREEN

XuAPI
pub const TEXT_GREEN = 27

Purpose

Constant TEXT_GREEN, defining protocol or algorithm parameters.

const TEXT_BLUE

XuAPI
pub const TEXT_BLUE = 28

Purpose

Constant TEXT_BLUE, defining protocol or algorithm parameters.

const TEXT_ALPHA

XuAPI
pub const TEXT_ALPHA = 29

Purpose

Constant TEXT_ALPHA, defining protocol or algorithm parameters.

const TEXT_SELECTED_ONE

XuAPI
pub const TEXT_SELECTED_ONE = 30

Purpose

Constant TEXT_SELECTED_ONE, defining protocol or algorithm parameters.

const TEXT_PAGE_SUMMARY

XuAPI
pub const TEXT_PAGE_SUMMARY = 63

Purpose

Constant TEXT_PAGE_SUMMARY, defining protocol or algorithm parameters.

const TEXT_ITEMS_PER_PAGE

XuAPI
pub const TEXT_ITEMS_PER_PAGE = 64

Purpose

Constant TEXT_ITEMS_PER_PAGE, defining protocol or algorithm parameters.

See usage example

locale_default

XuAPI
pub fn locale_default() Locale

Purpose

Locale default.

Parameters

No arguments are required.

Returns

Locale — a value of this type

locale_en_us

XuAPI
pub fn locale_en_us() Locale

Purpose

Locale en us.

Parameters

No arguments are required.

Returns

Locale — a value of this type

See usage example

locale_zh_cn

XuAPI
pub fn locale_zh_cn() Locale

Purpose

Locale zh cn.

Parameters

No arguments are required.

Returns

Locale — a value of this type

See usage example

(&Locale) clone

XuAPI
pub fn (locale &Locale) clone() Locale

Purpose

Copy the control or style snapshot into an independent Locale value.

Parameters

locale &Locale
The Locale instance used by this call (borrow).

Returns

Locale — a value of this type

(&Locale) validate

XuAPI
pub fn (locale &Locale) validate() int

Purpose

Execute validate on &Locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).

Returns

int — a value of this type

(&Locale) text

XuAPI
pub fn (locale &Locale) text(key int) string

Purpose

Operation on &Locale: return the current text. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
key int
key (int)

Returns

string — result string

($&Locale) set_text

XuAPI
pub fn (locale $&Locale) set_text(key int,text string) int

Purpose

Operation on $&Locale: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
key int
key (int)
text string
text (string)

Returns

int — a value of this type

($&Locale) set_weekdays

XuAPI
pub fn (locale $&Locale) set_weekdays(names &[]string) int

Purpose

Operation on $&Locale: set weekdays. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
names &[]string
names (read-only borrow; caller keeps the original; type &[]string)

Returns

int — a value of this type

($&Locale) set_months

XuAPI
pub fn (locale $&Locale) set_months(names &[]string) int

Purpose

Operation on $&Locale: set months. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
names &[]string
names (read-only borrow; caller keeps the original; type &[]string)

Returns

int — a value of this type

($&Locale) set_digits

XuAPI
pub fn (locale $&Locale) set_digits(names &[]string) int

Purpose

Operation on $&Locale: set digits. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
names &[]string
names (read-only borrow; caller keeps the original; type &[]string)

Returns

int — a value of this type

(&Locale) weekday

XuAPI
pub fn (locale &Locale) weekday(column int) string

Purpose

Execute weekday on &Locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
column int
column (int)

Returns

string — result string

(&Locale) number

XuAPI
pub fn (locale &Locale) number(value string,grouped bool) string

Purpose

Formats a canonical ASCII number for display, never for serialization or parsing.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
value string
value (string)
grouped bool
grouped (bool)

Returns

string — result string

(&Locale) integer

XuAPI
pub fn (locale &Locale) integer(value int) string

Purpose

Execute integer on &Locale.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
value int
value (int)

Returns

string — result string

(&Locale) count_text

XuAPI
pub fn (locale &Locale) count_text(key int,count int) string

Purpose

Operation on &Locale: count text. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
key int
key (int)
count int
count (int)

Returns

string — result string

(&Locale) date_text

XuAPI
pub fn (locale &Locale) date_text(value time.Time) string

Purpose

Operation on &Locale: date text. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
value time.Time
value (time.Time)

Returns

string — result string

(&Locale) calendar_title

XuAPI
pub fn (locale &Locale) calendar_title(value time.Time) string

Purpose

Operation on &Locale: calendar title. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale &Locale
The Locale instance used by this call (borrow).
value time.Time
value (time.Time)

Returns

string — result string

(&Locale) first_weekday

XuAPI
pub fn (locale &Locale) first_weekday() int

Purpose

Operation on &Locale: first weekday.

Parameters

locale &Locale
The Locale instance used by this call (borrow).

Returns

int — a value of this type

($&Locale) set_first_weekday

XuAPI
pub fn (locale $&Locale) set_first_weekday(day int) int

Purpose

Operation on $&Locale: set first weekday. Throws on failure; handle the error or propagate it to the caller.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
day int
day (int)

Returns

int — a value of this type

(&Locale) twelve_hour

XuAPI
pub fn (locale &Locale) twelve_hour() bool

Purpose

Operation on &Locale: twelve hour.

Parameters

locale &Locale
The Locale instance used by this call (borrow).

Returns

bool — true or false

($&Locale) set_12_hour

XuAPI
pub fn (locale $&Locale) set_12_hour(enabled bool)

Purpose

Operation on $&Locale: set 12 hour.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Locale) period_before

XuAPI
pub fn (locale &Locale) period_before() bool

Purpose

Operation on &Locale: period before.

Parameters

locale &Locale
The Locale instance used by this call (borrow).

Returns

bool — true or false

($&Locale) set_period_before

XuAPI
pub fn (locale $&Locale) set_period_before(before bool)

Purpose

Operation on $&Locale: set period before.

Parameters

locale $&Locale
The Locale instance used by this call (exclusive borrow).
before bool
before (bool)

Returns

This call does not return a value.

const MENU_DROPDOWN

XuAPI
pub const MENU_DROPDOWN = 0

Purpose

Constant MENU_DROPDOWN, defining protocol or algorithm parameters.

See usage example

const MENU_CONTEXT

XuAPI
pub const MENU_CONTEXT = 1

Purpose

Constant MENU_CONTEXT, defining protocol or algorithm parameters.

See usage example

const MENU_SPLIT

XuAPI
pub const MENU_SPLIT = 2

Purpose

Constant MENU_SPLIT, defining protocol or algorithm parameters.

See usage example

const MENU_ACTION

XuAPI
pub const MENU_ACTION = 0

Purpose

Constant MENU_ACTION, defining protocol or algorithm parameters.

const MENU_CHECK

XuAPI
pub const MENU_CHECK = 1

Purpose

Constant MENU_CHECK, defining protocol or algorithm parameters.

See usage example

const MENU_RADIO

XuAPI
pub const MENU_RADIO = 2

Purpose

Constant MENU_RADIO, defining protocol or algorithm parameters.

See usage example

const MENU_SEPARATOR

XuAPI
pub const MENU_SEPARATOR = 3

Purpose

Constant MENU_SEPARATOR, defining protocol or algorithm parameters.

See usage example

const MENU_HEADING

XuAPI
pub const MENU_HEADING = 4

Purpose

Constant MENU_HEADING, defining protocol or algorithm parameters.

See usage example

const MENU_SUBMENU

XuAPI
pub const MENU_SUBMENU = 5

Purpose

Constant MENU_SUBMENU, defining protocol or algorithm parameters.

See usage example

struct MenuItem

XuAPI
pub struct MenuItem {
    pub key int
    pub parent int
    pub label string
    pub shortcut_label string
    pub shortcut_key int
    pub shortcut_modifiers int
    pub kind int
    pub enabled bool
    pub checked bool
    pub radio_group int
}

Purpose

Structure encapsulating key, parent, label, shortcut_label, shortcut_key.

Public fields

key int
key
parent int
field (int)
label string
field (string)
shortcut_label string
field (string)
shortcut_key int
field (int)
shortcut_modifiers int
field (int)
kind int
kind tag
enabled bool
field (bool)
checked bool
field (bool)
radio_group int
field (int)

See usage example

struct MenuAppearance

XuAPI
pub struct MenuAppearance {
    pub row_height f64
    pub min_width f64
    pub max_width f64
    pub close_on_select bool
    pub hover_delay time.Duration
}

Purpose

Structure encapsulating row_height, min_width, max_width, close_on_select, hover_delay.

Public fields

row_height f64
field (f64)
min_width f64
field (f64)
max_width f64
field (f64)
close_on_select bool
field (bool)
hover_delay time.Duration
field (time.Duration)

struct Menu

XuAPI
pub struct Menu {

}

Purpose

Menu context or state structure.

Public fields

This type has no public fields.

(&Menu) id

XuAPI
pub fn (m &Menu) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

int — a value of this type

(&Menu) bounds

XuAPI
pub fn (m &Menu) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Menu) is_enabled

XuAPI
pub fn (m &Menu) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

bool — true or false

(&Menu) is_selectable

XuAPI
pub fn (m &Menu) is_selectable() bool

Purpose

Operation on &Menu: whether it is selectable.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

bool — true or false

($&Menu) set_selectable

XuAPI
pub fn (m $&Menu) set_selectable(selectable bool)

Purpose

Operation on $&Menu: set selectable.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Menu) is_open

XuAPI
pub fn (m &Menu) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

bool — true or false

(&Menu) opacity

XuAPI
pub fn (m &Menu) opacity() f64

Purpose

Execute opacity on &Menu.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

f64 — a value of this type

(&Menu) needs_paint

XuAPI
pub fn (m &Menu) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

bool — true or false

($&Menu) painted

XuAPI
pub fn (m $&Menu) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Menu) set_items

XuAPI
pub fn (m $&Menu) set_items(items &[]MenuItem) int

Purpose

Operation on $&Menu: set items. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
items &[]MenuItem
items (read-only borrow; caller keeps the original; type &[]MenuItem)

Returns

int — a value of this type

($&Menu) set_item_label

XuAPI
pub fn (m $&Menu) set_item_label(key int,label string) int

Purpose

Operation on $&Menu: set item label. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
key int
key (int)
label string
label (string)

Returns

int — a value of this type

($&Menu) set_label

XuAPI
pub fn (m $&Menu) set_label(label string)

Purpose

Operation on $&Menu: set label.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
label string
label (string)

Returns

This call does not return a value.

(&Menu) checked

XuAPI
pub fn (m &Menu) checked(key int) bool

Purpose

Execute checked on &Menu. Throws on failure; handle the error or propagate it to the caller.

Parameters

m &Menu
The Menu instance used by this call (borrow).
key int
key (int)

Returns

bool — true or false

($&Menu) set_checked

XuAPI
pub fn (m $&Menu) set_checked(key int,value bool) int

Purpose

Operation on $&Menu: set checked. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
key int
key (int)
value bool
value (bool)

Returns

int — a value of this type

($&Menu) set_item_enabled

XuAPI
pub fn (m $&Menu) set_item_enabled(key int,value bool) int

Purpose

Operation on $&Menu: set item enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
key int
key (int)
value bool
value (bool)

Returns

int — a value of this type

($&Menu) set_appearance

XuAPI
pub fn (m $&Menu) set_appearance(a &MenuAppearance) int

Purpose

Operation on $&Menu: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
a &MenuAppearance
value (read-only borrow; caller keeps the original; type &MenuAppearance)

Returns

int — a value of this type

($&Menu) close

XuAPI
pub fn (m $&Menu) close() int

Purpose

Operation on $&Menu: close the resource. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Menu) cancel

XuAPI
pub fn (m $&Menu) cancel()

Purpose

Execute cancel on $&Menu.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Menu) set_focus

XuAPI
pub fn (m $&Menu) set_focus(value bool)

Purpose

Operation on $&Menu: set focus.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&Menu) set_enabled

XuAPI
pub fn (m $&Menu) set_enabled(value bool)

Purpose

Operation on $&Menu: set enabled.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&Menu) set_read_only

XuAPI
pub fn (m $&Menu) set_read_only(value bool)

Purpose

Operation on $&Menu: set read only.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&Menu) set_bounds

XuAPI
pub fn (m $&Menu) set_bounds(b &layout.Rect) int

Purpose

Operation on $&Menu: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
b &layout.Rect
b (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Menu) set_style

XuAPI
pub fn (m $&Menu) set_style(style &ControlStyle) int

Purpose

Operation on $&Menu: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Menu) clear_style

XuAPI
pub fn (m $&Menu) clear_style()

Purpose

Operation on $&Menu: clear style.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Menu) set_motion

XuAPI
pub fn (m $&Menu) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Menu: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Menu) dispose

XuAPI
pub fn (m $&Menu) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Menu) popup_bounds

XuAPI
pub fn (m &Menu) popup_bounds() layout.Rect

Purpose

Operation on &Menu: popup bounds.

Parameters

m &Menu
The Menu instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Menu) set_viewport

XuAPI
pub fn (m $&Menu) set_viewport(viewport &layout.Rect) int

Purpose

Operation on $&Menu: set viewport. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Menu) apply_styles

XuAPI
pub fn (m $&Menu) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Menu) tick

XuAPI
pub fn (m $&Menu) tick(styles &Styles,now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&Menu) next_tick

XuAPI
pub fn (m &Menu) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Menu: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

m &Menu
The Menu instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&Menu) open_at

XuAPI
pub fn (m $&Menu) open_at(x f64,y f64,context bool) int

Purpose

Operation on $&Menu: open at. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
context bool
context (bool)

Returns

int — a value of this type

($&Menu) shortcut

XuAPI
pub fn (m $&Menu) shortcut(event &ui.InputEvent) Action

Purpose

Execute shortcut on $&Menu. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Menu) input

XuAPI
pub fn (m $&Menu) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Menu) route

XuAPI
pub fn (m $&Menu) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Menu) paint_styled

XuAPI
pub fn (m $&Menu) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Menu: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Menu) paint_popup_styled

XuAPI
pub fn (m $&Menu) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Menu: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Menu
The Menu instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

const EASE_LINEAR

XuAPI
pub const EASE_LINEAR = 0

Purpose

Constant EASE_LINEAR, defining protocol or algorithm parameters.

const EASE_OUT_QUART

XuAPI
pub const EASE_OUT_QUART = 1

Purpose

Constant EASE_OUT_QUART, defining protocol or algorithm parameters.

const EASE_OUT_QUINT

XuAPI
pub const EASE_OUT_QUINT = 2

Purpose

Constant EASE_OUT_QUINT, defining protocol or algorithm parameters.

See usage example

const EASE_IN_QUART

XuAPI
pub const EASE_IN_QUART = 3

Purpose

Constant EASE_IN_QUART, defining protocol or algorithm parameters.

const EASE_IN_OUT_CUBIC

XuAPI
pub const EASE_IN_OUT_CUBIC = 4

Purpose

Constant EASE_IN_OUT_CUBIC, defining protocol or algorithm parameters.

See usage example

const EASE_IN_QUINT

XuAPI
pub const EASE_IN_QUINT = 5

Purpose

Constant EASE_IN_QUINT, defining protocol or algorithm parameters.

struct MotionSpec

XuAPI
pub struct MotionSpec {
    pub hover time.Duration
    pub press time.Duration
    pub change time.Duration
    pub enter time.Duration
    pub exit time.Duration
    pub curve int
}

Purpose

Structure encapsulating hover, press, change, enter, exit.

Public fields

hover time.Duration
field (time.Duration)
press time.Duration
field (time.Duration)
change time.Duration
field (time.Duration)
enter time.Duration
field (time.Duration)
exit time.Duration
field (time.Duration)
curve int
field (int)

motion_spec

XuAPI
pub fn motion_spec() MotionSpec

Purpose

Motion spec.

Parameters

No arguments are required.

Returns

MotionSpec — a value of this type

See usage example

(&MotionSpec) validate

XuAPI
pub fn (spec &MotionSpec) validate() int

Purpose

Execute validate on &MotionSpec. Throws on failure; handle the error or propagate it to the caller.

Parameters

spec &MotionSpec
The MotionSpec instance used by this call (borrow).

Returns

int — a value of this type

struct Tween

XuAPI
pub struct Tween {

}

Purpose

Timestamps use time.instant; durations use time.milliseconds. Passing the clock explicitly keeps interrupted transitions deterministic.

Public fields

This type has no public fields.

See usage example

tween

XuAPI
pub fn tween(value f64) Tween

Purpose

Execute tween. Throws on failure; handle the error or propagate it to the caller.

Parameters

value f64
value (f64)

Returns

Tween — a value of this type

See usage example

($&Tween) set_curve

XuAPI
pub fn (t $&Tween) set_curve(curve int) int

Purpose

Operation on $&Tween: set curve. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tween
The Tween instance used by this call (exclusive borrow).
curve int
curve (int)

Returns

int — a value of this type

(&Tween) value

XuAPI
pub fn (t &Tween) value() f64

Purpose

Execute value on &Tween.

Parameters

t &Tween
The Tween instance used by this call (borrow).

Returns

f64 — a value of this type

(&Tween) is_animating

XuAPI
pub fn (t &Tween) is_animating() bool

Purpose

Operation on &Tween: whether it is animating.

Parameters

t &Tween
The Tween instance used by this call (borrow).

Returns

bool — true or false

($&Tween) snap

XuAPI
pub fn (t $&Tween) snap(value f64) int

Purpose

Execute snap on $&Tween. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tween
The Tween instance used by this call (exclusive borrow).
value f64
value (f64)

Returns

int — a value of this type

($&Tween) advance

XuAPI
pub fn (t $&Tween) advance(now time.Instant) bool

Purpose

Execute advance on $&Tween.

Parameters

t $&Tween
The Tween instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

bool — true or false

($&Tween) retarget

XuAPI
pub fn (t $&Tween) retarget(value f64,now time.Instant,duration time.Duration,reduced_motion bool) int

Purpose

Execute retarget on $&Tween. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tween
The Tween instance used by this call (exclusive borrow).
value f64
value (f64)
now time.Instant
now (time.Instant)
duration time.Duration
duration (time.Duration)
reduced_motion bool
reduced_motion (bool)

Returns

int — a value of this type

fade_color

XuAPI
pub fn fade_color(color draw.Color,opacity f64) draw.Color

Purpose

Fade color.

Parameters

color draw.Color
color (draw.Color)
opacity f64
opacity (f64)

Returns

draw.Color — a value of this type

(&ControlStyle) with_opacity

XuAPI
pub fn (base &ControlStyle) with_opacity(opacity f64) ControlStyle

Purpose

Operation on &ControlStyle: derive a new value with opacity. Throws on failure; handle the error or propagate it to the caller.

Parameters

base &ControlStyle
The ControlStyle instance used by this call (borrow).
opacity f64
opacity (f64)

Returns

ControlStyle — a value of this type

struct PaintTransition

XuAPI
pub struct PaintTransition {

}

Purpose

PaintTransition context or state structure.

Public fields

This type has no public fields.

See usage example

paint_transition

XuAPI
pub fn paint_transition() PaintTransition

Purpose

Paint transition. Throws on failure; handle the error or propagate it to the caller.

Parameters

No arguments are required.

Returns

PaintTransition — a value of this type

See usage example

($&PaintTransition) set_spec

XuAPI
pub fn (motion $&PaintTransition) set_spec(spec &MotionSpec) int

Purpose

Operation on $&PaintTransition: set spec. Throws on failure; handle the error or propagate it to the caller.

Parameters

motion $&PaintTransition
The PaintTransition instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

(&PaintTransition) next_tick

XuAPI
pub fn (motion &PaintTransition) next_tick(now time.Instant) time.Instant

Purpose

Operation on &PaintTransition: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

motion &PaintTransition
The PaintTransition instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

(&PaintTransition) is_animating

XuAPI
pub fn (motion &PaintTransition) is_animating() bool

Purpose

Operation on &PaintTransition: whether it is animating.

Parameters

motion &PaintTransition
The PaintTransition instance used by this call (borrow).

Returns

bool — true or false

($&PaintTransition) finish

XuAPI
pub fn (motion $&PaintTransition) finish()

Purpose

Execute finish on $&PaintTransition.

Parameters

motion $&PaintTransition
The PaintTransition instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&PaintTransition) advance

XuAPI
pub fn (motion $&PaintTransition) advance(now time.Instant) bool

Purpose

Execute advance on $&PaintTransition. Throws on failure; handle the error or propagate it to the caller.

Parameters

motion $&PaintTransition
The PaintTransition instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

bool — true or false

($&PaintTransition) style

XuAPI
pub fn (motion $&PaintTransition) style(base &ControlStyle,state int,now time.Instant,reduced_motion bool) ControlStyle

Purpose

Execute style on $&PaintTransition. Throws on failure; handle the error or propagate it to the caller.

Parameters

motion $&PaintTransition
The PaintTransition instance used by this call (exclusive borrow).
base &ControlStyle
numeric base (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

ControlStyle — a value of this type

($&Tween) retarget_unit

XuAPI
pub fn (t $&Tween) retarget_unit(value f64,now time.Instant,duration time.Duration,reduced bool) int

Purpose

Short reversals travel a shorter distance; keep their duration proportional. Advance with the old curve before replacing it to keep the handoff continuous. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tween
The Tween instance used by this call (exclusive borrow).
value f64
value (f64)
now time.Instant
now (time.Instant)
duration time.Duration
duration (time.Duration)
reduced bool
reduced (bool)

Returns

int — a value of this type

struct MultiSelect

XuAPI
pub struct MultiSelect {

}

Purpose

keyboard cursor; Escape, blur and an outside press close without clearing it.

Public fields

This type has no public fields.

multi_select

XuAPI
pub fn multi_select(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,options &[]string) MultiSelect

Purpose

Multi select. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)

Returns

MultiSelect — a value of this type

(&MultiSelect) id

XuAPI
pub fn (multi &MultiSelect) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

int — a value of this type

(&MultiSelect) bounds

XuAPI
pub fn (multi &MultiSelect) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&MultiSelect) is_open

XuAPI
pub fn (multi &MultiSelect) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

bool — true or false

(&MultiSelect) is_enabled

XuAPI
pub fn (multi &MultiSelect) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

bool — true or false

(&MultiSelect) is_selectable

XuAPI
pub fn (multi &MultiSelect) is_selectable() bool

Purpose

Operation on &MultiSelect: whether it is selectable.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

bool — true or false

($&MultiSelect) set_selectable

XuAPI
pub fn (multi $&MultiSelect) set_selectable(selectable bool)

Purpose

Operation on $&MultiSelect: set selectable.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&MultiSelect) needs_paint

XuAPI
pub fn (multi &MultiSelect) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

bool — true or false

(&MultiSelect) count

XuAPI
pub fn (multi &MultiSelect) count() int

Purpose

Return the number of items in this control.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

int — a value of this type

(&MultiSelect) selected

XuAPI
pub fn (multi &MultiSelect) selected(index int) bool

Purpose

Check whether one option is selected, for example after receiving a change action.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).
index int
Zero-based index in the original option list.

Returns

true if checked, otherwise false.

Error handling

  • An invalid index throws widgets: choice index out of range.

(&MultiSelect) values

XuAPI
pub fn (multi &MultiSelect) values() []int

Purpose

Return a slice containing all values in the collection.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

[]int — slice result

($&MultiSelect) set_selected

XuAPI
pub fn (multi $&MultiSelect) set_selected(index int,selected bool) int

Purpose

Set one option's checked state without changing other choices, for example when restoring form data.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
index int
Zero-based index in the original option list.
selected bool
true checks and false unchecks the option.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Error handling

  • A disposed control or index outside 0..count()-1 throws.

(&MultiSelect) style_or

XuAPI
pub fn (multi &MultiSelect) style_or(styles &Styles) ControlStyle

Purpose

Operation on &MultiSelect: style or.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&MultiSelect) set_style

XuAPI
pub fn (multi $&MultiSelect) set_style(style &ControlStyle) int

Purpose

Operation on $&MultiSelect: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&MultiSelect) set_enabled

XuAPI
pub fn (multi $&MultiSelect) set_enabled(enabled bool)

Purpose

Operation on $&MultiSelect: set enabled.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&MultiSelect) set_read_only

XuAPI
pub fn (multi $&MultiSelect) set_read_only(read_only bool) int

Purpose

Operation on $&MultiSelect: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&MultiSelect) set_invalid

XuAPI
pub fn (multi $&MultiSelect) set_invalid(invalid bool)

Purpose

Operation on $&MultiSelect: set invalid.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&MultiSelect) set_focus

XuAPI
pub fn (multi $&MultiSelect) set_focus(focused bool)

Purpose

Operation on $&MultiSelect: set focus.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&MultiSelect) set_open

XuAPI
pub fn (multi $&MultiSelect) set_open(open bool)

Purpose

Set whether the option list is open.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
open bool
true requests opening and false closes it; disabled or read-only controls remain closed.

Returns

No return value; read the resulting state with is_open().

Usage notes

  • Opening and painting are separate: call paint_popup_styled in an appropriate overlay pass.

($&MultiSelect) set_popup_above

XuAPI
pub fn (multi $&MultiSelect) set_popup_above(above bool)

Purpose

Operation on $&MultiSelect: set popup above.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
above bool
above (bool)

Returns

This call does not return a value.

($&MultiSelect) set_bounds

XuAPI
pub fn (multi $&MultiSelect) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&MultiSelect: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&MultiSelect) apply_styles

XuAPI
pub fn (multi $&MultiSelect) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&MultiSelect) popup_bounds

XuAPI
pub fn (multi &MultiSelect) popup_bounds() layout.Rect

Purpose

Read the option-list rectangle in canvas coordinates for overlay hit testing or layout.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).

Returns

The list's layout.Rect; reading it does not open the list, so also check is_open().

(&MultiSelect) option_bounds

XuAPI
pub fn (multi &MultiSelect) option_bounds(index int) layout.Rect

Purpose

Operation on &MultiSelect: option bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi &MultiSelect
The MultiSelect instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

($&MultiSelect) input

XuAPI
pub fn (multi $&MultiSelect) input(event &ui.InputEvent) Action

Purpose

Process opening, multiple selection and selected-chip interaction, updating control state.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
event &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • Toggling an option yields ACTION_CHANGE with the changed option index; call selected(index) for its new checked state.

($&MultiSelect) route

XuAPI
pub fn (multi $&MultiSelect) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&MultiSelect) event

XuAPI
pub fn (multi $&MultiSelect) event(event &ui.Event) Action

Purpose

Receive native window events, routing input to input and other events to the internal editor or base control.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
event &ui.Event
Full native ui.Event; use this entry point for IME, blur and lifecycle handling.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • The option list closes when its internal control loses focus.

($&MultiSelect) measure_styled

XuAPI
pub fn (multi $&MultiSelect) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&MultiSelect: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&MultiSelect) paint_styled

XuAPI
pub fn (multi $&MultiSelect) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&MultiSelect: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&MultiSelect) paint_popup_styled

XuAPI
pub fn (multi $&MultiSelect) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint the expanded option list separately from the field so it can appear above other controls.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
frame $&draw.Frame
Current frame to receive drawing commands.
styles &Styles
Effective styles supplying colors, spacing, fonts and state appearance.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • Paint in canvas coordinates, normally after regular controls. A field-local transform or clip can shift or cut off the list.

Error handling

  • Frame, text or style failures propagate as errors.

($&MultiSelect) dispose

XuAPI
pub fn (multi $&MultiSelect) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&MultiSelect) set_filter

XuAPI
pub fn (multi $&MultiSelect) set_filter(query &string) int

Purpose

Operation on $&MultiSelect: set filter. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
query &string
query (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&MultiSelect) select_all

XuAPI
pub fn (multi $&MultiSelect) select_all(selected bool) int

Purpose

Operation on $&MultiSelect: select all. Throws on failure; handle the error or propagate it to the caller.

Parameters

multi $&MultiSelect
The MultiSelect instance used by this call (exclusive borrow).
selected bool
selected (bool)

Returns

int — a value of this type

($&Screen) set_notice_style

XuAPI
pub fn (s $&Screen) set_notice_style(style &ControlStyle) int

Purpose

Operation on $&Screen: set notice style. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Screen) clear_notice_style

XuAPI
pub fn (s $&Screen) clear_notice_style() int

Purpose

Operation on $&Screen: clear notice style. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Screen) set_notice_motion

XuAPI
pub fn (s $&Screen) set_notice_motion(spec &MotionSpec) int

Purpose

Operation on $&Screen: set notice motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Screen) find_next_option

XuAPI
pub fn (s $&Screen) find_next_option(id int,prefix &string) int

Purpose

Unicode callers can provide a complete prefix from an editor or command. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
prefix &string
prefix (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

anchored_overlay_bounds

XuAPI
pub fn anchored_overlay_bounds(anchor &layout.Rect,size &layout.Size,viewport &layout.Rect) layout.Rect

Purpose

Placement is in logical canvas pixels. Dimensions are clipped to the viewport; the caller clips child content to bounds when painting it. Throws on failure; handle the error or propagate it to the caller.

Parameters

anchor &layout.Rect
anchor (read-only borrow; caller keeps the original; type &layout.Rect)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

layout.Rect — a value of this type

overlay_next_tick

XuAPI
pub fn overlay_next_tick(animated bool,now time.Instant) time.Instant

Purpose

Overlay next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

animated bool
animated (bool)
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

struct Popover

XuAPI
pub struct Popover {

}

Purpose

Anchored popover container attached to target element.

Public fields

This type has no public fields.

popover

XuAPI
pub fn popover(identity &ui.CanvasEvent,id int,anchor &layout.Rect,size &layout.Size,viewport &layout.Rect) Popover

Purpose

Execute popover. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
anchor &layout.Rect
anchor (read-only borrow; caller keeps the original; type &layout.Rect)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Popover — a value of this type

(&Popover) id

XuAPI
pub fn (p &Popover) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

int — a value of this type

(&Popover) bounds

XuAPI
pub fn (p &Popover) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Popover) is_enabled

XuAPI
pub fn (p &Popover) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

bool — true or false

(&Popover) is_selectable

XuAPI
pub fn (p &Popover) is_selectable() bool

Purpose

Operation on &Popover: whether it is selectable.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

bool — true or false

($&Popover) set_selectable

XuAPI
pub fn (p $&Popover) set_selectable(selectable bool)

Purpose

Operation on $&Popover: set selectable.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Popover) set_text

XuAPI
pub fn (p $&Popover) set_text(context &draw.Context,text &string) int

Purpose

Operation on $&Popover: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

(&Popover) has_popup_open

XuAPI
pub fn (p &Popover) has_popup_open() bool

Purpose

Operation on &Popover: whether it has popup open.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

bool — true or false

(&Popover) popup_bounds

XuAPI
pub fn (p &Popover) popup_bounds() layout.Rect

Purpose

Operation on &Popover: popup bounds.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Popover) selected_text

XuAPI
pub fn (p &Popover) selected_text() string

Purpose

Operation on &Popover: selected text.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

string — result string

(&Popover) copy_selection

XuAPI
pub fn (p &Popover) copy_selection() int

Purpose

Operation on &Popover: copy selection.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

int — a value of this type

(&Popover) selection_range

XuAPI
pub fn (p &Popover) selection_range() ui.TextRange

Purpose

Operation on &Popover: selection range.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

ui.TextRange — a value of this type

(&Popover) cursor

XuAPI
pub fn (p &Popover) cursor() int

Purpose

Execute cursor on &Popover.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

int — a value of this type

($&Popover) set_viewport

XuAPI
pub fn (p $&Popover) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&Popover: set viewport.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&Popover) set_locale

XuAPI
pub fn (p $&Popover) set_locale(locale &Locale) int

Purpose

Operation on $&Popover: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

(&Popover) is_open

XuAPI
pub fn (p &Popover) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

bool — true or false

(&Popover) is_visible

XuAPI
pub fn (p &Popover) is_visible() bool

Purpose

Check whether the popover remains visible, including its exit transition.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

true while open or fading out, and false once fully hidden.

(&Popover) opacity

XuAPI
pub fn (p &Popover) opacity() f64

Purpose

Execute opacity on &Popover.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

f64 — a value of this type

(&Popover) needs_paint

XuAPI
pub fn (p &Popover) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

p &Popover
The Popover instance used by this call (borrow).

Returns

bool — true or false

($&Popover) painted

XuAPI
pub fn (p $&Popover) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Popover) set_geometry

XuAPI
pub fn (p $&Popover) set_geometry(anchor &layout.Rect,size &layout.Size,viewport &layout.Rect) int

Purpose

Operation on $&Popover: set geometry. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
anchor &layout.Rect
anchor (read-only borrow; caller keeps the original; type &layout.Rect)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Popover) open

XuAPI
pub fn (p $&Popover) open(now time.Instant,reduced_motion bool) int

Purpose

Open the popover with its entrance animation; a disabled popover stays closed.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
now time.Instant
Current animation time.Instant; use the same time basis for opening, ticking and closing.
reduced_motion bool
Whether to reduce motion; true moves directly to the target state.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • Advance animation with tick each frame and use is_visible to decide whether painting must continue.

Error handling

  • Invalid animation parameters or state throw.

($&Popover) close

XuAPI
pub fn (p $&Popover) close(now time.Instant,reduced_motion bool) int

Purpose

Request closing with an exit animation; painting may continue briefly after logical closure.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
now time.Instant
Current animation time.Instant; use the same time basis for opening, ticking and closing.
reduced_motion bool
Whether to reduce motion; true moves directly to the target state.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • is_open() becomes false on the close request; is_visible() becomes false after the exit animation ends.

Error handling

  • Animation failures propagate.

($&Popover) set_enabled

XuAPI
pub fn (p $&Popover) set_enabled(enabled bool) int

Purpose

Operation on $&Popover: set enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Popover) tick

XuAPI
pub fn (p $&Popover) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance the fade animation to the current time and use the result to schedule repainting.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
now time.Instant
Current animation time.Instant; use the same time basis for opening, ticking and closing.
reduced_motion bool
Whether to reduce motion; true moves directly to the target state.

Returns

true when opacity changes, otherwise false.

Error handling

  • Invalid time or animation state throws.

(&Popover) next_tick

XuAPI
pub fn (p &Popover) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Popover: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

p &Popover
The Popover instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&Popover) input

XuAPI
pub fn (p $&Popover) input(event &ui.InputEvent) Action

Purpose

Handle outside presses, Escape and cancellation according to the popover's dismissal settings.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
event &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • Presses inside the anchor or panel are not outside dismissal; the caller continues dispatching interactions to panel content.

($&Popover) route

XuAPI
pub fn (p $&Popover) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Popover) paint_styled

XuAPI
pub fn (p &Popover) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint the popover panel background and border.

Parameters

p &Popover
The Popover instance used by this call (borrow).
frame $&draw.Frame
Current frame to receive drawing commands.
styles &Styles
Effective styles supplying colors, spacing, fonts and state appearance.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • The caller paints panel content; this call does not create, lay out or dispatch content controls.

Error handling

  • Drawing failures propagate.

($&Popover) paint_content_styled

XuAPI
pub fn (p $&Popover) paint_content_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Popover: paint content styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Popover) paint_popup_styled

XuAPI
pub fn (p $&Popover) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Popover: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Modal

XuAPI
pub struct Modal {

}

Purpose

Modal owns the keyboard focus order, while the host owns the actual child controls. Use blocks_input as the dispatch gate, including the closing fade. Cancel background View input before open (cancel_input) to release capture and native editor focus. Apply focused_id after open/input, and restore take_restore_focus after tick reports the closing fade finished. Never dispatch to background while blocks_input first call input, honor consumed even when that input closes the modal, then dispatch only to modal children if allows_content.

Public fields

This type has no public fields.

(&Modal) id

XuAPI
pub fn (m &Modal) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

int — a value of this type

(&Modal) bounds

XuAPI
pub fn (m &Modal) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Modal) is_enabled

XuAPI
pub fn (m &Modal) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

bool — true or false

(&Modal) is_selectable

XuAPI
pub fn (m &Modal) is_selectable() bool

Purpose

Operation on &Modal: whether it is selectable.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

bool — true or false

($&Modal) set_selectable

XuAPI
pub fn (m $&Modal) set_selectable(selectable bool)

Purpose

Operation on $&Modal: set selectable.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Modal) set_text

XuAPI
pub fn (m $&Modal) set_text(context &draw.Context,text &string) int

Purpose

Operation on $&Modal: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

(&Modal) has_popup_open

XuAPI
pub fn (m &Modal) has_popup_open() bool

Purpose

Operation on &Modal: whether it has popup open.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

bool — true or false

(&Modal) popup_bounds

XuAPI
pub fn (m &Modal) popup_bounds() layout.Rect

Purpose

Operation on &Modal: popup bounds.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Modal) selected_text

XuAPI
pub fn (m &Modal) selected_text() string

Purpose

Operation on &Modal: selected text.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

string — result string

(&Modal) copy_selection

XuAPI
pub fn (m &Modal) copy_selection() int

Purpose

Operation on &Modal: copy selection.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

int — a value of this type

(&Modal) cursor

XuAPI
pub fn (m &Modal) cursor() int

Purpose

Execute cursor on &Modal.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

int — a value of this type

($&Modal) set_locale

XuAPI
pub fn (m $&Modal) set_locale(locale &Locale) int

Purpose

Operation on $&Modal: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

(&Modal) is_open

XuAPI
pub fn (m &Modal) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

bool — true or false

(&Modal) is_visible

XuAPI
pub fn (m &Modal) is_visible() bool

Purpose

Check whether the modal remains visible, including its exit transition.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

true while open or fading out, and false once fully hidden.

(&Modal) blocks_input

XuAPI
pub fn (m &Modal) blocks_input() bool

Purpose

Keep background input blocked throughout the closing fade.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

bool — true or false

(&Modal) opacity

XuAPI
pub fn (m &Modal) opacity() f64

Purpose

Execute opacity on &Modal.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

f64 — a value of this type

(&Modal) needs_paint

XuAPI
pub fn (m &Modal) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

bool — true or false

($&Modal) painted

XuAPI
pub fn (m $&Modal) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Modal) set_dismiss_on_outside

XuAPI
pub fn (m $&Modal) set_dismiss_on_outside(enabled bool)

Purpose

Operation on $&Modal: set dismiss on outside.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Modal) focused_id

XuAPI
pub fn (m &Modal) focused_id() int

Purpose

Operation on &Modal: focused id.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

int — a value of this type

(&Modal) focus_restore_id

XuAPI
pub fn (m &Modal) focus_restore_id() int

Purpose

Operation on &Modal: focus restore id.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

int — a value of this type

($&Modal) take_restore_focus

XuAPI
pub fn (m $&Modal) take_restore_focus() int

Purpose

Consume the one-time focus restoration target once the modal is fully hidden.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).

Returns

Control ID to restore, or 0 while visible or without a pending request. Each request is consumed once.

(&Modal) contains_focus

XuAPI
pub fn (m &Modal) contains_focus(id int) bool

Purpose

Operation on &Modal: contains focus.

Parameters

m &Modal
The Modal instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

($&Modal) set_focus_order

XuAPI
pub fn (m $&Modal) set_focus_order(ids &[]int) int

Purpose

Set the modal's Tab traversal order so keyboard focus cycles through the specified controls.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
ids &[]int
Ordered content control IDs, at most 256; IDs must be positive, unique and different from the modal's own ID.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • Retain the old focus when listed, otherwise select the first target; an empty list has no content focus target.

Error handling

  • An invalid count, ID or duplicate throws.

($&Modal) set_content_focus

XuAPI
pub fn (m $&Modal) set_content_focus(id int) int

Purpose

Operation on $&Modal: set content focus. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Modal) open

XuAPI
pub fn (m $&Modal) open(now time.Instant,reduced_motion bool,restore_focus int) int

Purpose

Open the modal and remember the focus restoration target.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
now time.Instant
Current animation time.Instant; use the same time basis for opening, ticking and closing.
reduced_motion bool
Whether to reduce motion; true moves directly to the target state.
restore_focus int
Control ID to restore after closing; 0 means no target and negative values are invalid.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • Advance animation with tick each frame and use is_visible to decide whether painting must continue.

Error handling

  • Invalid animation parameters or state throw. A negative focus restoration ID also throws.

($&Modal) close

XuAPI
pub fn (m $&Modal) close(now time.Instant,reduced_motion bool) int

Purpose

Request closing with an exit animation; painting may continue briefly after logical closure.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
now time.Instant
Current animation time.Instant; use the same time basis for opening, ticking and closing.
reduced_motion bool
Whether to reduce motion; true moves directly to the target state.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • is_open() becomes false on the close request; is_visible() becomes false after the exit animation ends.

Error handling

  • Animation failures propagate.

($&Modal) set_enabled

XuAPI
pub fn (m $&Modal) set_enabled(enabled bool) int

Purpose

Operation on $&Modal: set enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Modal) set_geometry

XuAPI
pub fn (m $&Modal) set_geometry(bounds &layout.Rect,viewport &layout.Rect) int

Purpose

Operation on $&Modal: set geometry. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Modal) close_bounds

XuAPI
pub fn (m &Modal) close_bounds() layout.Rect

Purpose

Operation on &Modal: close bounds.

Parameters

m &Modal
The Modal instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Modal) allows_content

XuAPI
pub fn (m &Modal) allows_content(event &ui.InputEvent) bool

Purpose

Decide whether input may reach modal content after modal-first dispatch.

Parameters

m &Modal
The Modal instance used by this call (borrow).
event &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

true when allowed; false when closed, mismatched, handling Tab/Escape, or hitting the close button.

Usage notes

  • Keyboard input also requires a content focus target; pointer input must be inside the panel.

($&Modal) input

XuAPI
pub fn (m $&Modal) input(event &ui.InputEvent) Action

Purpose

Handle modal dismissal and Tab focus cycling before deciding whether content can receive input.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
event &ui.InputEvent
Input event for the same window, canvas and generation, with coordinates in the control's canvas space.

Returns

An Action: kind identifies the action, consumed marks a handled event, request_focus requests focus, and needs_paint requests repainting.

Usage notes

  • Dispatch before background controls and use allows_content for content input. The modal continues blocking background input during its exit animation.

($&Modal) route

XuAPI
pub fn (m $&Modal) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Modal) tick

XuAPI
pub fn (m $&Modal) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance the fade animation to the current time and use the result to schedule repainting.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
now time.Instant
Current animation time.Instant; use the same time basis for opening, ticking and closing.
reduced_motion bool
Whether to reduce motion; true moves directly to the target state.

Returns

true when opacity changes, otherwise false.

Error handling

  • Invalid time or animation state throws.

(&Modal) next_tick

XuAPI
pub fn (m &Modal) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Modal: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

m &Modal
The Modal instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

(&Modal) paint_styled

XuAPI
pub fn (m &Modal) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint the modal backdrop, panel and close button.

Parameters

m &Modal
The Modal instance used by this call (borrow).
frame $&draw.Frame
Current frame to receive drawing commands.
styles &Styles
Effective styles supplying colors, spacing, fonts and state appearance.

Returns

Returns 0 on success; failure throws rather than returning a nonzero status.

Usage notes

  • The backdrop uses Styles.overlay_scrim() with alpha scaled by the modal animation.
  • The caller paints panel content; this call does not create, lay out or dispatch content controls.

Error handling

  • Drawing failures propagate.

($&Modal) paint_content_styled

XuAPI
pub fn (m $&Modal) paint_content_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Modal: paint content styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Modal) paint_popup_styled

XuAPI
pub fn (m $&Modal) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Modal: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Popover) style_or

XuAPI
pub fn (p &Popover) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Popover: style or.

Parameters

p &Popover
The Popover instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Popover) set_style

XuAPI
pub fn (p $&Popover) set_style(style &ControlStyle) int

Purpose

Operation on $&Popover: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Popover) set_motion

XuAPI
pub fn (p $&Popover) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Popover: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Popover
The Popover instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Modal) set_style

XuAPI
pub fn (m $&Modal) set_style(style &ControlStyle) int

Purpose

Operation on $&Modal: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Modal) set_motion

XuAPI
pub fn (m $&Modal) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Modal: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&Modal
The Modal instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

struct Pagination

XuAPI
pub struct Pagination {

}

Purpose

Zero based page state. Endpoints and a bounded page window are materialized; callers retain ownership of the actual paged data. Zero pages has current == -1.

Public fields

This type has no public fields.

pagination

XuAPI
pub fn pagination(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,pages int,current int) Pagination

Purpose

Execute pagination. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
pages int
pages (int)
current int
current (int)

Returns

Pagination — a value of this type

(&Pagination) id

XuAPI
pub fn (p &Pagination) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

int — a value of this type

(&Pagination) bounds

XuAPI
pub fn (p &Pagination) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Pagination) page_count

XuAPI
pub fn (p &Pagination) page_count() int

Purpose

Operation on &Pagination: page count.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

int — a value of this type

(&Pagination) selected

XuAPI
pub fn (p &Pagination) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

int — a value of this type

(&Pagination) needs_paint

XuAPI
pub fn (p &Pagination) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

bool — true or false

($&Pagination) painted

XuAPI
pub fn (p $&Pagination) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Pagination) is_enabled

XuAPI
pub fn (p &Pagination) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

bool — true or false

(&Pagination) is_selectable

XuAPI
pub fn (p &Pagination) is_selectable() bool

Purpose

Operation on &Pagination: whether it is selectable.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

bool — true or false

($&Pagination) set_selectable

XuAPI
pub fn (p $&Pagination) set_selectable(selectable bool)

Purpose

Operation on $&Pagination: set selectable.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Pagination) is_focused

XuAPI
pub fn (p &Pagination) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

bool — true or false

(&Pagination) is_read_only

XuAPI
pub fn (p &Pagination) is_read_only() bool

Purpose

Operation on &Pagination: whether it is read only.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).

Returns

bool — true or false

($&Pagination) cancel

XuAPI
pub fn (p $&Pagination) cancel()

Purpose

Execute cancel on $&Pagination.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Pagination) set_focus

XuAPI
pub fn (p $&Pagination) set_focus(focused bool)

Purpose

Operation on $&Pagination: set focus.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Pagination) set_enabled

XuAPI
pub fn (p $&Pagination) set_enabled(enabled bool)

Purpose

Operation on $&Pagination: set enabled.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Pagination) set_read_only

XuAPI
pub fn (p $&Pagination) set_read_only(value bool) int

Purpose

Operation on $&Pagination: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

int — a value of this type

($&Pagination) set_page_count

XuAPI
pub fn (p $&Pagination) set_page_count(pages int) int

Purpose

Operation on $&Pagination: set page count. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
pages int
pages (int)

Returns

int — a value of this type

($&Pagination) set_selected

XuAPI
pub fn (p $&Pagination) set_selected(index int) int

Purpose

Operation on $&Pagination: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&Pagination) set_bounds

XuAPI
pub fn (p $&Pagination) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Pagination: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Pagination) style_or

XuAPI
pub fn (p &Pagination) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Pagination: style or.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Pagination) set_style

XuAPI
pub fn (p $&Pagination) set_style(style &ControlStyle) int

Purpose

Operation on $&Pagination: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Pagination) clear_style

XuAPI
pub fn (p $&Pagination) clear_style()

Purpose

Operation on $&Pagination: clear style.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Pagination) apply_styles

XuAPI
pub fn (p $&Pagination) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Pagination) item_bounds

XuAPI
pub fn (p &Pagination) item_bounds(slot int) layout.Rect

Purpose

Operation on &Pagination: item bounds.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).
slot int
slot (int)

Returns

layout.Rect — a value of this type

($&Pagination) input

XuAPI
pub fn (p $&Pagination) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Pagination) route

XuAPI
pub fn (p $&Pagination) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Pagination) event

XuAPI
pub fn (p $&Pagination) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Pagination) measure_styled

XuAPI
pub fn (p $&Pagination) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&Pagination: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&Pagination) paint_styled

XuAPI
pub fn (p $&Pagination) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Pagination: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Pagination) dispose

XuAPI
pub fn (p $&Pagination) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct PaginationAppearance

XuAPI
pub struct PaginationAppearance {
    pub gap f64
    pub min_item_width f64
    pub stretch bool
}

Purpose

Structure encapsulating gap, min_item_width, stretch.

Public fields

gap f64
field (f64)
min_item_width f64
field (f64)
stretch bool
field (bool)

pagination_appearance

XuAPI
pub fn pagination_appearance() PaginationAppearance

Purpose

Pagination appearance.

Parameters

No arguments are required.

Returns

PaginationAppearance — a value of this type

($&Pagination) set_appearance

XuAPI
pub fn (page $&Pagination) set_appearance(appearance &PaginationAppearance) int

Purpose

Operation on $&Pagination: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

page $&Pagination
The Pagination instance used by this call (exclusive borrow).
appearance &PaginationAppearance
appearance (read-only borrow; caller keeps the original; type &PaginationAppearance)

Returns

int — a value of this type

struct PaginationData

XuAPI
pub struct PaginationData {
    pub total int
    pub page_size int
    pub pages int
    pub current int
}

Purpose

Structure encapsulating total, page_size, pages, current.

Public fields

total int
field (int)
page_size int
field (int)
pages int
field (int)
current int
field (int)

(&Pagination) data

XuAPI
pub fn (page &Pagination) data() PaginationData

Purpose

Execute data on &Pagination.

Parameters

page &Pagination
The Pagination instance used by this call (borrow).

Returns

PaginationData — a value of this type

($&Pagination) set_data

XuAPI
pub fn (page $&Pagination) set_data(total int,page_size int) int

Purpose

Keep the first item being viewed visible when page size changes. Throws on failure; handle the error or propagate it to the caller.

Parameters

page $&Pagination
The Pagination instance used by this call (exclusive borrow).
total int
total (int)
page_size int
page_size (int)

Returns

int — a value of this type

($&Pagination) jump

XuAPI
pub fn (page $&Pagination) jump(one_based int) int

Purpose

Execute jump on $&Pagination. Throws on failure; handle the error or propagate it to the caller.

Parameters

page $&Pagination
The Pagination instance used by this call (exclusive borrow).
one_based int
one_based (int)

Returns

int — a value of this type

(&Pagination) summary_text

XuAPI
pub fn (page &Pagination) summary_text() string

Purpose

Operation on &Pagination: summary text. Throws on failure; handle the error or propagate it to the caller.

Parameters

page &Pagination
The Pagination instance used by this call (borrow).

Returns

string — result string

($&Screen) set_pagination_data

XuAPI
pub fn (s $&Screen) set_pagination_data(id int,total int,page_size int) int

Purpose

Operation on $&Screen: set pagination data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
total int
total (int)
page_size int
page_size (int)

Returns

int — a value of this type

($&Screen) pagination_data

XuAPI
pub fn (s $&Screen) pagination_data(id int) PaginationData

Purpose

Operation on $&Screen: pagination data. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

PaginationData — a value of this type

($&Screen) pagination_summary

XuAPI
pub fn (s $&Screen) pagination_summary(id int) string

Purpose

Operation on $&Screen: pagination summary. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

string — result string

($&Pagination) set_motion

XuAPI
pub fn (p $&Pagination) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Pagination: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Pagination) tick

XuAPI
pub fn (p $&Pagination) tick(styles &Styles,now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

p $&Pagination
The Pagination instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&Pagination) next_tick

XuAPI
pub fn (p &Pagination) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Pagination: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

p &Pagination
The Pagination instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

(&Switch) is_pending

XuAPI
pub fn (sw &Switch) is_pending() bool

Purpose

Operation on &Switch: whether it is pending.

Parameters

sw &Switch
The Switch instance used by this call (borrow).

Returns

bool — true or false

($&Switch) set_pending

XuAPI
pub fn (sw $&Switch) set_pending(pending bool)

Purpose

Business code completes or rolls back the value and then clears pending. The switch keeps keyboard focus while suppressing repeated submissions.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
pending bool
pending (bool)

Returns

This call does not return a value.

($&Screen) set_switch_pending

XuAPI
pub fn (s $&Screen) set_switch_pending(id int,pending bool) int

Purpose

Operation on $&Screen: set switch pending. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
pending bool
pending (bool)

Returns

int — a value of this type

const OVERLAY_BOTTOM

XuAPI
pub const OVERLAY_BOTTOM = 0

Purpose

Constant OVERLAY_BOTTOM, defining protocol or algorithm parameters.

const OVERLAY_TOP

XuAPI
pub const OVERLAY_TOP = 1

Purpose

Constant OVERLAY_TOP, defining protocol or algorithm parameters.

See usage example

const OVERLAY_LEFT

XuAPI
pub const OVERLAY_LEFT = 2

Purpose

Constant OVERLAY_LEFT, defining protocol or algorithm parameters.

const OVERLAY_RIGHT

XuAPI
pub const OVERLAY_RIGHT = 3

Purpose

Constant OVERLAY_RIGHT, defining protocol or algorithm parameters.

const OVERLAY_START

XuAPI
pub const OVERLAY_START = 0

Purpose

Constant OVERLAY_START, defining protocol or algorithm parameters.

const OVERLAY_CENTER

XuAPI
pub const OVERLAY_CENTER = 1

Purpose

Constant OVERLAY_CENTER, defining protocol or algorithm parameters.

See usage example

const OVERLAY_END

XuAPI
pub const OVERLAY_END = 2

Purpose

Constant OVERLAY_END, defining protocol or algorithm parameters.

struct OverlayPlacement

XuAPI
pub struct OverlayPlacement {
    pub side int
    pub align int
    pub gap f64
    pub offset f64
    pub flip bool
}

Purpose

Structure encapsulating side, align, gap, offset, flip.

Public fields

side int
field (int)
align int
field (int)
gap f64
field (f64)
offset f64
offset
flip bool
field (bool)

overlay_placement

XuAPI
pub fn overlay_placement() OverlayPlacement

Purpose

Overlay placement.

Parameters

No arguments are required.

Returns

OverlayPlacement — a value of this type

See usage example

placed_overlay_bounds

XuAPI
pub fn placed_overlay_bounds(anchor &layout.Rect,size &layout.Size,viewport &layout.Rect,placement &OverlayPlacement) layout.Rect

Purpose

Placed overlay bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

anchor &layout.Rect
anchor (read-only borrow; caller keeps the original; type &layout.Rect)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)
placement &OverlayPlacement
placement (read-only borrow; caller keeps the original; type &OverlayPlacement)

Returns

layout.Rect — a value of this type

($&Popover) set_placement

XuAPI
pub fn (panel $&Popover) set_placement(placement &OverlayPlacement) int

Purpose

Operation on $&Popover: set placement. Throws on failure; handle the error or propagate it to the caller.

Parameters

panel $&Popover
The Popover instance used by this call (exclusive borrow).
placement &OverlayPlacement
placement (read-only borrow; caller keeps the original; type &OverlayPlacement)

Returns

int — a value of this type

($&Popover) set_dismissal

XuAPI
pub fn (panel $&Popover) set_dismissal(outside bool,escape bool)

Purpose

Operation on $&Popover: set dismissal.

Parameters

panel $&Popover
The Popover instance used by this call (exclusive borrow).
outside bool
outside (bool)
escape bool
escape (bool)

Returns

This call does not return a value.

($&Screen) set_popover_placement

XuAPI
pub fn (s $&Screen) set_popover_placement(id int,placement &OverlayPlacement) int

Purpose

Operation on $&Screen: set popover placement. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
placement &OverlayPlacement
placement (read-only borrow; caller keeps the original; type &OverlayPlacement)

Returns

int — a value of this type

($&Screen) set_tooltip_placement

XuAPI
pub fn (s $&Screen) set_tooltip_placement(id int,placement &OverlayPlacement) int

Purpose

Operation on $&Screen: set tooltip placement. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
placement &OverlayPlacement
placement (read-only borrow; caller keeps the original; type &OverlayPlacement)

Returns

int — a value of this type

($&Screen) set_popover_dismissal

XuAPI
pub fn (s $&Screen) set_popover_dismissal(id int,outside bool,escape bool) int

Purpose

Operation on $&Screen: set popover dismissal. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
outside bool
outside (bool)
escape bool
escape (bool)

Returns

int — a value of this type

struct RadioGroup

XuAPI
pub struct RadioGroup {

}

Purpose

One focus stop owns the selection and arrow-key navigation for the group.

Public fields

This type has no public fields.

radio_group

XuAPI
pub fn radio_group(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,options &[]string,selected int) RadioGroup

Purpose

Radio group. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)

Returns

RadioGroup — a value of this type

(&RadioGroup) id

XuAPI
pub fn (g &RadioGroup) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

int — a value of this type

(&RadioGroup) bounds

XuAPI
pub fn (g &RadioGroup) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&RadioGroup) count

XuAPI
pub fn (g &RadioGroup) count() int

Purpose

Return the number of items in this control.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

int — a value of this type

(&RadioGroup) selected

XuAPI
pub fn (g &RadioGroup) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

int — a value of this type

(&RadioGroup) needs_paint

XuAPI
pub fn (g &RadioGroup) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

bool — true or false

(&RadioGroup) is_enabled

XuAPI
pub fn (g &RadioGroup) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

bool — true or false

(&RadioGroup) is_selectable

XuAPI
pub fn (g &RadioGroup) is_selectable() bool

Purpose

Operation on &RadioGroup: whether it is selectable.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

bool — true or false

($&RadioGroup) set_selectable

XuAPI
pub fn (g $&RadioGroup) set_selectable(selectable bool)

Purpose

Operation on $&RadioGroup: set selectable.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&RadioGroup) is_focused

XuAPI
pub fn (g &RadioGroup) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).

Returns

bool — true or false

($&RadioGroup) set_horizontal

XuAPI
pub fn (g $&RadioGroup) set_horizontal(horizontal bool)

Purpose

Operation on $&RadioGroup: set horizontal.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
horizontal bool
horizontal (bool)

Returns

This call does not return a value.

($&RadioGroup) set_focus

XuAPI
pub fn (g $&RadioGroup) set_focus(focused bool)

Purpose

Operation on $&RadioGroup: set focus.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&RadioGroup) set_enabled

XuAPI
pub fn (g $&RadioGroup) set_enabled(enabled bool)

Purpose

Operation on $&RadioGroup: set enabled.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&RadioGroup) set_read_only

XuAPI
pub fn (g $&RadioGroup) set_read_only(value bool)

Purpose

Operation on $&RadioGroup: set read only.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&RadioGroup) set_selected

XuAPI
pub fn (g $&RadioGroup) set_selected(index int) int

Purpose

Operation on $&RadioGroup: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&RadioGroup) set_bounds

XuAPI
pub fn (g $&RadioGroup) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&RadioGroup: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&RadioGroup) style_or

XuAPI
pub fn (g &RadioGroup) style_or(styles &Styles) ControlStyle

Purpose

Operation on &RadioGroup: style or.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&RadioGroup) set_style

XuAPI
pub fn (g $&RadioGroup) set_style(style &ControlStyle) int

Purpose

Operation on $&RadioGroup: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&RadioGroup) painted

XuAPI
pub fn (g $&RadioGroup) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RadioGroup) cancel

XuAPI
pub fn (g $&RadioGroup) cancel()

Purpose

Execute cancel on $&RadioGroup.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&RadioGroup) item_bounds

XuAPI
pub fn (g &RadioGroup) item_bounds(index int) layout.Rect

Purpose

Operation on &RadioGroup: item bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

g &RadioGroup
The RadioGroup instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

($&RadioGroup) input

XuAPI
pub fn (g $&RadioGroup) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&RadioGroup) route

XuAPI
pub fn (g $&RadioGroup) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&RadioGroup) measure_styled

XuAPI
pub fn (g $&RadioGroup) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&RadioGroup: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&RadioGroup) paint_styled

XuAPI
pub fn (g $&RadioGroup) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&RadioGroup: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&RadioGroup) dispose

XuAPI
pub fn (g $&RadioGroup) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

g $&RadioGroup
The RadioGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

const RANGE_CLAMP

XuAPI
pub const RANGE_CLAMP = 0

Purpose

Constant RANGE_CLAMP, defining protocol or algorithm parameters.

const RANGE_PUSH

XuAPI
pub const RANGE_PUSH = 1

Purpose

Constant RANGE_PUSH, defining protocol or algorithm parameters.

See usage example

struct RangeValues

XuAPI
pub struct RangeValues {
    pub lower f64
    pub upper f64
    pub active int
}

Purpose

Structure encapsulating lower, upper, active.

Public fields

lower f64
field (f64)
upper f64
field (f64)
active int
field (int)

struct RangeSliderOptions

XuAPI
pub struct RangeSliderOptions {
    pub step f64
    pub min_distance f64
    pub collision int
    pub vertical bool
    pub reversed bool
    pub drag_range bool
    pub commit_only bool
}

Purpose

Widgets Configuration parameters and options set.

Public fields

step f64
field (f64)
min_distance f64
field (f64)
collision int
field (int)
vertical bool
field (bool)
reversed bool
field (bool)
drag_range bool
field (bool)
commit_only bool
field (bool)

range_slider_options

XuAPI
pub fn range_slider_options() RangeSliderOptions

Purpose

Range slider options.

Parameters

No arguments are required.

Returns

RangeSliderOptions — a value of this type

See usage example

struct RangeSlider

XuAPI
pub struct RangeSlider {

}

Purpose

RangeSlider context or state structure.

Public fields

This type has no public fields.

range_slider

XuAPI
pub fn range_slider(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,minimum f64,maximum f64,lower f64,upper f64) RangeSlider

Purpose

Values are bounded numeric data. Invalid configuration is rejected atomically. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
minimum f64
minimum (f64)
maximum f64
maximum (f64)
lower f64
lower (f64)
upper f64
upper (f64)

Returns

RangeSlider — a value of this type

(&RangeSlider) id

XuAPI
pub fn (r &RangeSlider) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).

Returns

int — a value of this type

(&RangeSlider) bounds

XuAPI
pub fn (r &RangeSlider) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&RangeSlider) values

XuAPI
pub fn (r &RangeSlider) values() RangeValues

Purpose

Return a slice containing all values in the collection.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).

Returns

RangeValues — a value of this type

(&RangeSlider) needs_paint

XuAPI
pub fn (r &RangeSlider) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).

Returns

bool — true or false

($&RangeSlider) painted

XuAPI
pub fn (r $&RangeSlider) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&RangeSlider) is_enabled

XuAPI
pub fn (r &RangeSlider) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).

Returns

bool — true or false

(&RangeSlider) style_or

XuAPI
pub fn (r &RangeSlider) style_or(styles &Styles) ControlStyle

Purpose

Operation on &RangeSlider: style or.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&RangeSlider) set_values

XuAPI
pub fn (r $&RangeSlider) set_values(lower f64,upper f64) int

Purpose

Operation on $&RangeSlider: set values. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
lower f64
lower (f64)
upper f64
upper (f64)

Returns

int — a value of this type

($&RangeSlider) set_options

XuAPI
pub fn (r $&RangeSlider) set_options(o &RangeSliderOptions) int

Purpose

Operation on $&RangeSlider: set options. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
o &RangeSliderOptions
o (read-only borrow; caller keeps the original; type &RangeSliderOptions)

Returns

int — a value of this type

($&RangeSlider) set_appearance

XuAPI
pub fn (r $&RangeSlider) set_appearance(a &SliderAppearance) int

Purpose

Operation on $&RangeSlider: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
a &SliderAppearance
value (read-only borrow; caller keeps the original; type &SliderAppearance)

Returns

int — a value of this type

($&RangeSlider) set_locale

XuAPI
pub fn (r $&RangeSlider) set_locale(locale &Locale) int

Purpose

Operation on $&RangeSlider: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&RangeSlider) set_style

XuAPI
pub fn (r $&RangeSlider) set_style(style &ControlStyle) int

Purpose

Operation on $&RangeSlider: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&RangeSlider) clear_style

XuAPI
pub fn (r $&RangeSlider) clear_style()

Purpose

Operation on $&RangeSlider: clear style.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RangeSlider) set_motion

XuAPI
pub fn (r $&RangeSlider) set_motion(spec &MotionSpec) int

Purpose

Operation on $&RangeSlider: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&RangeSlider) cancel

XuAPI
pub fn (r $&RangeSlider) cancel()

Purpose

Execute cancel on $&RangeSlider.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RangeSlider) set_focus

XuAPI
pub fn (r $&RangeSlider) set_focus(value bool)

Purpose

Operation on $&RangeSlider: set focus.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&RangeSlider) set_enabled

XuAPI
pub fn (r $&RangeSlider) set_enabled(value bool)

Purpose

Operation on $&RangeSlider: set enabled.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&RangeSlider) set_read_only

XuAPI
pub fn (r $&RangeSlider) set_read_only(value bool)

Purpose

Operation on $&RangeSlider: set read only.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&RangeSlider) set_bounds

XuAPI
pub fn (r $&RangeSlider) set_bounds(b &layout.Rect) int

Purpose

Operation on $&RangeSlider: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
b &layout.Rect
b (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&RangeSlider) dispose

XuAPI
pub fn (r $&RangeSlider) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&RangeSlider) tab

XuAPI
pub fn (r $&RangeSlider) tab(backward bool,entering bool) bool

Purpose

A RangeSlider has two Tab stops. Screen calls this before moving to another node.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
backward bool
backward (bool)
entering bool
entering (bool)

Returns

bool — true or false

($&RangeSlider) input

XuAPI
pub fn (r $&RangeSlider) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&RangeSlider) route

XuAPI
pub fn (r $&RangeSlider) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&RangeSlider) apply_styles

XuAPI
pub fn (r $&RangeSlider) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&RangeSlider) tick

XuAPI
pub fn (r $&RangeSlider) tick(styles &Styles,now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&RangeSlider) next_tick

XuAPI
pub fn (r &RangeSlider) next_tick(now time.Instant) time.Instant

Purpose

Operation on &RangeSlider: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

r &RangeSlider
The RangeSlider instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&RangeSlider) paint_styled

XuAPI
pub fn (r $&RangeSlider) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&RangeSlider: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&RangeSlider
The RangeSlider instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

const SPAN_NORMAL

XuAPI
pub const SPAN_NORMAL = 0

Purpose

Inline text styling flags for RichText spans.

const SPAN_BOLD

XuAPI
pub const SPAN_BOLD = 1

Purpose

Constant SPAN_BOLD, defining protocol or algorithm parameters.

const SPAN_ITALIC

XuAPI
pub const SPAN_ITALIC = 2

Purpose

Constant SPAN_ITALIC, defining protocol or algorithm parameters.

const SPAN_CODE

XuAPI
pub const SPAN_CODE = 4

Purpose

Constant SPAN_CODE, defining protocol or algorithm parameters.

const SPAN_UNDERLINE

XuAPI
pub const SPAN_UNDERLINE = 8

Purpose

Constant SPAN_UNDERLINE, defining protocol or algorithm parameters.

const SPAN_STRIKETHROUGH

XuAPI
pub const SPAN_STRIKETHROUGH = 16

Purpose

Constant SPAN_STRIKETHROUGH, defining protocol or algorithm parameters.

struct TextSpan

XuAPI
pub struct TextSpan {
    pub text string
    pub flags int
    pub link_url string
    pub color draw.Color
}

Purpose

Structure encapsulating text, flags, link_url, color.

Public fields

text string
text
flags int
field (int)
link_url string
field (string)
color draw.Color
field (draw.Color)

text_span

XuAPI
pub fn text_span(text string, flags int) TextSpan

Purpose

Text span.

Parameters

text string
text (string)
flags int
flags (int)

Returns

TextSpan — a value of this type

(&TextSpan) has_flag

XuAPI
pub fn (span &TextSpan) has_flag(flag int) bool

Purpose

Operation on &TextSpan: whether it has flag.

Parameters

span &TextSpan
The TextSpan instance used by this call (borrow).
flag int
flag (int)

Returns

bool — true or false

($&TextSpan) toggle_flag

XuAPI
pub fn (span $&TextSpan) toggle_flag(flag int)

Purpose

Operation on $&TextSpan: toggle flag.

Parameters

span $&TextSpan
The TextSpan instance used by this call (exclusive borrow).
flag int
flag (int)

Returns

This call does not return a value.

(&TextSpan) clone

XuAPI
pub fn (span &TextSpan) clone() TextSpan

Purpose

Copy the control or style snapshot into an independent TextSpan value.

Parameters

span &TextSpan
The TextSpan instance used by this call (borrow).

Returns

TextSpan — a value of this type

struct RichParagraph

XuAPI
pub struct RichParagraph {
    pub spans []TextSpan
    pub heading_level int
}

Purpose

Structure encapsulating spans, heading_level.

Public fields

spans []TextSpan
field ([]TextSpan)
heading_level int
field (int)

rich_paragraph

XuAPI
pub fn rich_paragraph(heading int) RichParagraph

Purpose

Rich paragraph.

Parameters

heading int
heading (int)

Returns

RichParagraph — a value of this type

(&RichParagraph) text

XuAPI
pub fn (p &RichParagraph) text() string

Purpose

Operation on &RichParagraph: return the current text.

Parameters

p &RichParagraph
The RichParagraph instance used by this call (borrow).

Returns

string — result string

($&RichParagraph) append_span

XuAPI
pub fn (p $&RichParagraph) append_span(span TextSpan)

Purpose

Operation on $&RichParagraph: append span.

Parameters

p $&RichParagraph
The RichParagraph instance used by this call (exclusive borrow).
span TextSpan
span (TextSpan)

Returns

This call does not return a value.

struct RichDocument

XuAPI
pub struct RichDocument {
    pub paragraphs []RichParagraph
    pub anchor int
    pub focus int
}

Purpose

Structure encapsulating paragraphs, anchor, focus.

Public fields

paragraphs []RichParagraph
field ([]RichParagraph)
anchor int
field (int)
focus int
field (int)

rich_document

XuAPI
pub fn rich_document() RichDocument

Purpose

Rich document.

Parameters

No arguments are required.

Returns

RichDocument — a value of this type

(&RichDocument) is_empty

XuAPI
pub fn (doc &RichDocument) is_empty() bool

Purpose

Operation on &RichDocument: whether it is empty.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

bool — true or false

($&RichDocument) append_paragraph

XuAPI
pub fn (doc $&RichDocument) append_paragraph(heading int) int

Purpose

Operation on $&RichDocument: append paragraph.

Parameters

doc $&RichDocument
The RichDocument instance used by this call (exclusive borrow).
heading int
heading (int)

Returns

int — a value of this type

($&RichDocument) append_span

XuAPI
pub fn (doc $&RichDocument) append_span(para_idx int, span TextSpan) int

Purpose

Operation on $&RichDocument: append span. Throws on failure; handle the error or propagate it to the caller.

Parameters

doc $&RichDocument
The RichDocument instance used by this call (exclusive borrow).
para_idx int
para_idx (int)
span TextSpan
span (TextSpan)

Returns

int — a value of this type

(&RichDocument) to_plain_text

XuAPI
pub fn (doc &RichDocument) to_plain_text() string

Purpose

Operation on &RichDocument: convert to plain text.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

string — result string

(&RichDocument) char_count

XuAPI
pub fn (doc &RichDocument) char_count() int

Purpose

Operation on &RichDocument: char count.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

int — a value of this type

($&RichDocument) set_selection

XuAPI
pub fn (doc $&RichDocument) set_selection(anchor int, focus int)

Purpose

Operation on $&RichDocument: set selection.

Parameters

doc $&RichDocument
The RichDocument instance used by this call (exclusive borrow).
anchor int
anchor (int)
focus int
focus (int)

Returns

This call does not return a value.

(&RichDocument) has_selection

XuAPI
pub fn (doc &RichDocument) has_selection() bool

Purpose

Operation on &RichDocument: whether it has selection.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

bool — true or false

(&RichDocument) is_copy_enabled

XuAPI
pub fn (doc &RichDocument) is_copy_enabled() bool

Purpose

Operation on &RichDocument: whether it is copy enabled.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

bool — true or false

($&RichDocument) set_copy_enabled

XuAPI
pub fn (doc $&RichDocument) set_copy_enabled(on bool)

Purpose

Operation on $&RichDocument: set copy enabled.

Parameters

doc $&RichDocument
The RichDocument instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

This call does not return a value.

(&RichDocument) selection_range

XuAPI
pub fn (doc &RichDocument) selection_range() TextRange

Purpose

Operation on &RichDocument: selection range.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

TextRange — a value of this type

(&RichDocument) selected_text

XuAPI
pub fn (doc &RichDocument) selected_text() string

Purpose

Plain-text slice of the current selection, suitable for clipboard copy. Indexes are UTF-8 byte offsets into to_plain_text. Empty when copy is disabled.

Parameters

doc &RichDocument
The RichDocument instance used by this call (borrow).

Returns

string — result string

const SCREEN_SECRET_INPUT

XuAPI
pub const SCREEN_SECRET_INPUT = 35

Purpose

Constant SCREEN_SECRET_INPUT, defining protocol or algorithm parameters.

const SCREEN_SELECTABLE_TEXT

XuAPI
pub const SCREEN_SELECTABLE_TEXT = 40

Purpose

Constant SCREEN_SELECTABLE_TEXT, defining protocol or algorithm parameters.

const ACTION_KEY

XuAPI
pub const ACTION_KEY = 5

Purpose

Constant ACTION_KEY, defining protocol or algorithm parameters.

See usage example

struct ScreenNodeInfo

XuAPI
pub struct ScreenNodeInfo {
    pub id int
    pub kind int
    pub parent int
    pub x f64
    pub y f64
    pub width f64
    pub height f64
    pub visible bool
    pub enabled bool
    pub focusable bool
    pub focused bool
    pub text string
    pub secure bool
}

Purpose

A bounded, immutable view of one retained screen node for tooling adapters. The internal node remains private so callers cannot forge handles or mutate layout/resource state behind Screen's lifecycle checks.

Public fields

id int
field (int)
kind int
kind tag
parent int
field (int)
x f64
value
y f64
value
width f64
field (f64)
height f64
field (f64)
visible bool
field (bool)
enabled bool
field (bool)
focusable bool
field (bool)
focused bool
field (bool)
text string
text
secure bool
field (bool)

const XACP_MAX_NODES

XuAPI
pub const XACP_MAX_NODES = 512

Purpose

Constant XACP_MAX_NODES, defining protocol or algorithm parameters.

const XACP_MAX_NODE_TEXT

XuAPI
pub const XACP_MAX_NODE_TEXT = 65536

Purpose

Constant XACP_MAX_NODE_TEXT, defining protocol or algorithm parameters.

struct Screen

XuAPI
pub struct Screen {

}

Purpose

Screen context or state structure.

Public fields

This type has no public fields.

See usage example

screen

XuAPI
pub fn screen(ready &ui.Event) Screen

Purpose

Execute screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

ready &ui.Event
ready (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Screen — a value of this type

See usage example

(&Screen) is_open

XuAPI
pub fn (s &Screen) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

bool — true or false

(&Screen) xacp_window_id

XuAPI
pub fn (s &Screen) xacp_window_id() int

Purpose

Operation on &Screen: xacp window id.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

int — a value of this type

(&Screen) xacp_canvas_id

XuAPI
pub fn (s &Screen) xacp_canvas_id() int

Purpose

Operation on &Screen: xacp canvas id.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

int — a value of this type

(&Screen) xacp_generation

XuAPI
pub fn (s &Screen) xacp_generation() int

Purpose

Operation on &Screen: xacp generation.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

int — a value of this type

(&Screen) xacp_close_events

XuAPI
pub fn (s &Screen) xacp_close_events() chan int

Purpose

A single control attachment may observe close/dispose without retaining a Screen reference. The Screen owner is the sole sender; notification is bounded.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

chan int — a value of this type

(&Screen) width

XuAPI
pub fn (s &Screen) width() f64

Purpose

Execute width on &Screen.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

f64 — a value of this type

(&Screen) height

XuAPI
pub fn (s &Screen) height() f64

Purpose

Execute height on &Screen.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

f64 — a value of this type

(&Screen) focused

XuAPI
pub fn (s &Screen) focused() int

Purpose

Execute focused on &Screen.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

int — a value of this type

(&Screen) reduced_motion

XuAPI
pub fn (s &Screen) reduced_motion() bool

Purpose

Operation on &Screen: reduced motion.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

bool — true or false

(&Screen) viewport

XuAPI
pub fn (s &Screen) viewport() layout.Rect

Purpose

Execute viewport on &Screen.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Screen) invalidate

XuAPI
pub fn (s $&Screen) invalidate()

Purpose

Invalidate the control area, requesting a repaint on next frame.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Screen) resize

XuAPI
pub fn (s $&Screen) resize(width f64,height f64) int

Purpose

Execute resize on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
width f64
width (f64)
height f64
height (f64)

Returns

int — a value of this type

($&Screen) set_min_size

XuAPI
pub fn (s $&Screen) set_min_size(width int,height int) int

Purpose

Operation on $&Screen: set min size. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
width int
width (int)
height int
height (int)

Returns

int — a value of this type

($&Screen) set_styles

XuAPI
pub fn (s $&Screen) set_styles(styles &Styles) int

Purpose

Operation on $&Screen: set styles. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Screen) styles

XuAPI
pub fn (s &Screen) styles() Styles

Purpose

Execute styles on &Screen.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

Styles — a value of this type

(&Screen) row_height

XuAPI
pub fn (s &Screen) row_height() f64

Purpose

Operation on &Screen: row height.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

f64 — a value of this type

($&Screen) set_reduced_motion

XuAPI
pub fn (s $&Screen) set_reduced_motion(reduced bool)

Purpose

Operation on $&Screen: set reduced motion.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
reduced bool
reduced (bool)

Returns

This call does not return a value.

($&Screen) group

XuAPI
pub fn (s $&Screen) group() int

Purpose

Execute group on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Screen) button

XuAPI
pub fn (s $&Screen) button(text string) int

Purpose

Create Button in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) label

XuAPI
pub fn (s $&Screen) label(text string,size f64,muted bool) int

Purpose

Create StyledLabel in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)
size f64
size (f64)
muted bool
muted (bool)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_text

XuAPI
pub fn (s $&Screen) set_text(id int,text string) int

Purpose

Operation on $&Screen: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
text string
text (string)

Returns

int — a value of this type

($&Screen) set_selected_button

XuAPI
pub fn (s $&Screen) set_selected_button(id int,selected bool) int

Purpose

Operation on $&Screen: set selected button. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
selected bool
selected (bool)

Returns

int — a value of this type

(&Screen) is_descendant

XuAPI
pub fn (s &Screen) is_descendant(id int,parent int) bool

Purpose

Operation on &Screen: whether it is descendant.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)
parent int
parent (int)

Returns

bool — true or false

(&Screen) is_visible

XuAPI
pub fn (s &Screen) is_visible(id int) bool

Purpose

Operation on &Screen: whether it is visible.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

($&Screen) set_parent

XuAPI
pub fn (s $&Screen) set_parent(id int,parent int) int

Purpose

Operation on $&Screen: set parent. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
parent int
parent (int)

Returns

int — a value of this type

($&Screen) set_visible

XuAPI
pub fn (s $&Screen) set_visible(id int,visible bool) int

Purpose

Operation on $&Screen: set visible. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
visible bool
visible (bool)

Returns

int — a value of this type

($&Screen) set_enabled

XuAPI
pub fn (s $&Screen) set_enabled(id int,enabled bool) int

Purpose

Operation on $&Screen: set enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) place

XuAPI
pub fn (s $&Screen) place(id int,x f64,y f64,width f64,height f64) int

Purpose

Compute and place control bounds within canvas layout. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
x f64
value (f64)
y f64
value (f64)
width f64
width (f64)
height f64
height (f64)

Returns

int — a value of this type

(&Screen) bounds

XuAPI
pub fn (s &Screen) bounds(id int) layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

layout.Rect — a value of this type

($&Screen) xacp_tree

XuAPI
pub fn (s $&Screen) xacp_tree(include_hidden bool,max_rows int) []ScreenNodeInfo

Purpose

xacp_tree is the only public node enumeration API. It lays out controls before copying data, caps the result, and returns no internal handles. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
include_hidden bool
include_hidden (bool)
max_rows int
max_rows (int)

Returns

[]ScreenNodeInfo — slice result

($&Screen) xacp_input

XuAPI
pub fn (s $&Screen) xacp_input(events &[]ui.InputEvent,max_events int) []Action

Purpose

xacp_input validates canvas identity before dispatching every event. A foreign or stale generation is an error rather than a silently ignored UI operation, which prevents use-after-close and cross-window event injection. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
events &[]ui.InputEvent
events (read-only borrow; caller keeps the original; type &[]ui.InputEvent)
max_events int
max_events (int)

Returns

[]Action — slice result

($&Screen) xacp_act

XuAPI
pub fn (s $&Screen) xacp_act(id int,act string,text string,checked bool) []Action

Purpose

xacp_act provides the small, schema-approved action set. Click is routed through the normal pointer path, so hit testing, modal rules and focus transitions remain identical to native input. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
act string
act (string)
text string
text (string)
checked bool
checked (bool)

Returns

[]Action — slice result

($&Screen) cancel_all

XuAPI
pub fn (s $&Screen) cancel_all() int

Purpose

Operation on $&Screen: cancel all. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Screen) focus

XuAPI
pub fn (s $&Screen) focus(id int) int

Purpose

Execute focus on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) render

XuAPI
pub fn (s $&Screen) render() bool

Purpose

Execute render on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

bool — true or false

($&Screen) export_xdf

XuAPI
pub fn (s $&Screen) export_xdf() string

Purpose

Operation on $&Screen: export xdf. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

string — result string

($&Screen) snapshot

XuAPI
pub fn (s $&Screen) snapshot(scale f64) draw.Surface

Purpose

Export/preview still uses the same placement and layer ordering as render. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
scale f64
scale (f64)

Returns

draw.Surface — a value of this type

($&Screen) snapshot_node

XuAPI
pub fn (s $&Screen) snapshot_node(id int,scale f64) draw.Surface

Purpose

snapshot_node uses the same paint order as the full snapshot while clipping and translating the requested node rectangle. The returned Surface remains an owning native resource and must be disposed by the caller. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
scale f64
scale (f64)

Returns

draw.Surface — a value of this type

($&Screen) advance

XuAPI
pub fn (s $&Screen) advance(now time.Instant) time.Instant

Purpose

Execute advance on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&Screen) dispatch

XuAPI
pub fn (s $&Screen) dispatch(input &ui.InputEvent) []Action

Purpose

Execute dispatch on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

[]Action — slice result

($&Screen) event

XuAPI
pub fn (s $&Screen) event(event &ui.Event) []Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

[]Action — slice result

($&Screen) next

XuAPI
pub fn (s $&Screen) next(events chan ui.Event) []Action

Purpose

Block when idle; coalesce non-semantic input bursts before one repaint. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
events chan ui.Event
events (channel; type chan ui.Event)

Returns

[]Action — slice result

($&Screen) close

XuAPI
pub fn (s $&Screen) close() int

Purpose

Operation on $&Screen: close the resource. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Screen) dispose

XuAPI
pub fn (s $&Screen) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct@ ScreenHandler

XuAPI
pub struct@ ScreenHandler {
    fn layout($&Screen) int
    fn update($&Screen,Action) int
}

Purpose

The callback owns business state only. Screen owns dispatch, rendering, native resources and cleanup, including errors from either callback.

Required methods

layout fn layout($&Screen) int
Execute layout on ScreenHandler.
update fn update($&Screen,Action) int
Execute update on ScreenHandler.

(ScreenHandler) layout

XuAPI
fn layout($&Screen) int

Purpose

Execute layout on ScreenHandler.

Parameters

self Self
The Self instance used by this call (value receiver).
screen $&Screen
screen (exclusive borrow; may modify the original; type $&Screen)

Returns

int — a value of this type

(ScreenHandler) update

XuAPI
fn update($&Screen,Action) int

Purpose

Execute update on ScreenHandler.

Parameters

self Self
The Self instance used by this call (value receiver).
screen $&Screen
screen (exclusive borrow; may modify the original; type $&Screen)
action Action
action (Action)

Returns

int — a value of this type

run_screen

XuAPI
pub fn run_screen#H:ScreenHandler(s $&Screen,events chan ui.Event,handler $&H,tables <-> ActionDispatcher#H,Screen,Action) int

Purpose

Existing three-argument callers use update as the fallback. Supply one table to register functions; its fallback (if set) runs before legacy update. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
s (exclusive borrow; may modify the original; type $&Screen)
events chan ui.Event
events (channel; type chan ui.Event)
handler $&H
handler (exclusive borrow; may modify the original; type $&H)
tables <-> ActionDispatcher#H
variadic ActionDispatcher#H (seen inside the function as []ActionDispatcher#H)
screen Screen
screen (Screen)
action Action
action (Action)

Returns

int — a value of this type

($&Screen) take_actions

XuAPI
pub fn (s $&Screen) take_actions() []Action

Purpose

next drains these automatically. Custom event loops call this after advance to receive timer-driven actions such as Stepper repetition.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

[]Action — slice result

($&Screen) set_tree_appearance

XuAPI
pub fn (s $&Screen) set_tree_appearance(id int,appearance &TreeAppearance) int

Purpose

Operation on $&Screen: set tree appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &TreeAppearance
appearance (read-only borrow; caller keeps the original; type &TreeAppearance)

Returns

int — a value of this type

($&Screen) set_tree_metadata

XuAPI
pub fn (s $&Screen) set_tree_metadata(id int,node int,value string) int

Purpose

Operation on $&Screen: set tree metadata. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
node int
node (int)
value string
value (string)

Returns

int — a value of this type

($&Screen) set_tree_action

XuAPI
pub fn (s $&Screen) set_tree_action(id int,node int,enabled bool) int

Purpose

Operation on $&Screen: set tree action. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
node int
node (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) set_tree_filter

XuAPI
pub fn (s $&Screen) set_tree_filter(id int,query string) int

Purpose

Operation on $&Screen: set tree filter. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
query string
query (string)

Returns

int — a value of this type

($&Screen) set_field_invalid

XuAPI
pub fn (s $&Screen) set_field_invalid(id int,invalid bool) int

Purpose

Operation on $&Screen: set field invalid. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
invalid bool
invalid (bool)

Returns

int — a value of this type

($&Screen) set_field_read_only

XuAPI
pub fn (s $&Screen) set_field_read_only(id int,read_only bool) int

Purpose

Operation on $&Screen: set field read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
read_only bool
read_only (bool)

Returns

int — a value of this type

($&Screen) set_task_labels

XuAPI
pub fn (s $&Screen) set_task_labels(id int,running string,success string,error string,cancelled string) int

Purpose

Operation on $&Screen: set task labels. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
running string
running (string)
success string
success (string)
error string
error (string)
cancelled string
cancelled (string)

Returns

int — a value of this type

($&Screen) checkbox

XuAPI
pub fn (s $&Screen) checkbox(text string,checked bool) int

Purpose

Create Checkbox in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)
checked bool
checked (bool)

Returns

int — component node ID for place and other Screen methods.

($&Screen) switch_control

XuAPI
pub fn (s $&Screen) switch_control(text string,checked bool) int

Purpose

Create Switch in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)
checked bool
checked (bool)

Returns

int — component node ID for place and other Screen methods.

($&Screen) radio

XuAPI
pub fn (s $&Screen) radio(text string,option int,checked bool) int

Purpose

Create Radio in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)
option int
option (int)
checked bool
checked (bool)

Returns

int — component node ID for place and other Screen methods.

($&Screen) slider

XuAPI
pub fn (s $&Screen) slider(minimum f64,maximum f64,value f64) int

Purpose

Create Slider in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
minimum f64
minimum (f64)
maximum f64
maximum (f64)
value f64
value (f64)

Returns

int — component node ID for place and other Screen methods.

($&Screen) stepper

XuAPI
pub fn (s $&Screen) stepper(minimum f64,maximum f64,step f64,value f64) int

Purpose

Create Stepper in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
minimum f64
minimum (f64)
maximum f64
maximum (f64)
step f64
step (f64)
value f64
value (f64)

Returns

int — component node ID for place and other Screen methods.

($&Screen) tabs

XuAPI
pub fn (s $&Screen) tabs(options &[]string,selected int) int

Purpose

Create Tabs in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) select_box

XuAPI
pub fn (s $&Screen) select_box(options &[]string,selected int) int

Purpose

Create Select in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) list_box

XuAPI
pub fn (s $&Screen) list_box(options &[]string,selected int) int

Purpose

Create ListBox in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) progress

XuAPI
pub fn (s $&Screen) progress(value f64) int

Purpose

Create Progress in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value f64
value (f64)

Returns

int — component node ID for place and other Screen methods.

($&Screen) divider

XuAPI
pub fn (s $&Screen) divider(axis int) int

Purpose

Create Divider in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
axis int
axis (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) badge

XuAPI
pub fn (s $&Screen) badge(text string) int

Purpose

Create Badge in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) card

XuAPI
pub fn (s $&Screen) card() int

Purpose

Create Card in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — component node ID for place and other Screen methods.

($&Screen) segmented

XuAPI
pub fn (s $&Screen) segmented(options &[]string,selected int) int

Purpose

Create Segmented in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) toggle_value

XuAPI
pub fn (s $&Screen) toggle_value(id int) bool

Purpose

Operation on $&Screen: toggle value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

bool — true or false

($&Screen) number_value

XuAPI
pub fn (s $&Screen) number_value(id int) f64

Purpose

Operation on $&Screen: number value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

f64 — a value of this type

($&Screen) set_toggle_value

XuAPI
pub fn (s $&Screen) set_toggle_value(id int,checked bool) int

Purpose

Operation on $&Screen: set toggle value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
checked bool
checked (bool)

Returns

int — a value of this type

($&Screen) set_number_value

XuAPI
pub fn (s $&Screen) set_number_value(id int,value f64) int

Purpose

Operation on $&Screen: set number value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value f64
value (f64)

Returns

int — a value of this type

($&Screen) radio_group

XuAPI
pub fn (s $&Screen) radio_group(options &[]string,selected int) int

Purpose

Create RadioGroup in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
selected int
selected (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_candidate_open

XuAPI
pub fn (s $&Screen) set_candidate_open(id int,open bool) int

Purpose

Operation on $&Screen: set candidate open. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
open bool
open (bool)

Returns

int — a value of this type

($&Screen) set_chart_series

XuAPI
pub fn (s $&Screen) set_chart_series(id int,series &[]chart.ChartSeries) int

Purpose

Operation on $&Screen: set chart series. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
series &[]chart.ChartSeries
series (read-only borrow; caller keeps the original; type &[]chart.ChartSeries)

Returns

int — a value of this type

($&Screen) set_chart_appearance

XuAPI
pub fn (s $&Screen) set_chart_appearance(id int,appearance &chart.ChartAppearance) int

Purpose

Operation on $&Screen: set chart appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &chart.ChartAppearance
appearance (read-only borrow; caller keeps the original; type &chart.ChartAppearance)

Returns

int — a value of this type

($&Screen) set_chart_domain

XuAPI
pub fn (s $&Screen) set_chart_domain(id int,domain &chart.ChartDomain) int

Purpose

Operation on $&Screen: set chart domain. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
domain &chart.ChartDomain
domain (read-only borrow; caller keeps the original; type &chart.ChartDomain)

Returns

int — a value of this type

($&Screen) set_chart_viewport

XuAPI
pub fn (s $&Screen) set_chart_viewport(id int,view &chart.ChartDomain) int

Purpose

Operation on $&Screen: set chart viewport. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
view &chart.ChartDomain
view (read-only borrow; caller keeps the original; type &chart.ChartDomain)

Returns

int — a value of this type

($&Screen) set_chart_animation

XuAPI
pub fn (s $&Screen) set_chart_animation(id int,options &AnimationOptions) int

Purpose

Operation on $&Screen: set chart animation. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
options &AnimationOptions
options (read-only borrow; caller keeps the original; type &AnimationOptions)

Returns

int — a value of this type

($&Screen) seek_chart_animation

XuAPI
pub fn (s $&Screen) seek_chart_animation(id int,progress f64) int

Purpose

Operation on $&Screen: seek chart animation. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
progress f64
progress (f64)

Returns

int — a value of this type

($&Screen) pause_chart_animation

XuAPI
pub fn (s $&Screen) pause_chart_animation(id int) int

Purpose

Operation on $&Screen: pause chart animation. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) resume_chart_animation

XuAPI
pub fn (s $&Screen) resume_chart_animation(id int) int

Purpose

Operation on $&Screen: resume chart animation. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) reset_chart_viewport

XuAPI
pub fn (s $&Screen) reset_chart_viewport(id int) int

Purpose

Operation on $&Screen: reset chart viewport. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) use_chart_auto_domain

XuAPI
pub fn (s $&Screen) use_chart_auto_domain(id int) int

Purpose

Operation on $&Screen: use chart auto domain. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) select_chart_point

XuAPI
pub fn (s $&Screen) select_chart_point(id int,series_id int,point_id int) int

Purpose

Operation on $&Screen: select chart point. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
series_id int
series_id (int)
point_id int
point_id (int)

Returns

int — a value of this type

($&Screen) set_chart_series_visible

XuAPI
pub fn (s $&Screen) set_chart_series_visible(id int,series_id int,visible bool) int

Purpose

Operation on $&Screen: set chart series visible. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
series_id int
series_id (int)
visible bool
visible (bool)

Returns

int — a value of this type

($&Screen) chart_locale

XuAPI
pub fn (s $&Screen) chart_locale(id int,locale &Locale) int

Purpose

Operation on $&Screen: chart locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Screen) chart_hovered

XuAPI
pub fn (s $&Screen) chart_hovered(id int) chart.ChartHit

Purpose

Operation on $&Screen: chart hovered. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

chart.ChartHit — a value of this type

($&Screen) chart_selection

XuAPI
pub fn (s $&Screen) chart_selection(id int) chart.ChartHit

Purpose

Operation on $&Screen: chart selection. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

chart.ChartHit — a value of this type

($&Screen) chart_viewport

XuAPI
pub fn (s $&Screen) chart_viewport(id int) chart.ChartDomain

Purpose

Operation on $&Screen: chart viewport. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

chart.ChartDomain — a value of this type

($&Screen) chart_animation_progress

XuAPI
pub fn (s $&Screen) chart_animation_progress(id int) f64

Purpose

Operation on $&Screen: chart animation progress. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

f64 — a value of this type

($&Screen) set_button_group_items

XuAPI
pub fn (s $&Screen) set_button_group_items(id int,items &[]ButtonGroupItem) int

Purpose

Operation on $&Screen: set button group items. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
items &[]ButtonGroupItem
items (read-only borrow; caller keeps the original; type &[]ButtonGroupItem)

Returns

int — a value of this type

($&Screen) set_button_group_appearance

XuAPI
pub fn (s $&Screen) set_button_group_appearance(id int,appearance &ButtonGroupAppearance) int

Purpose

Operation on $&Screen: set button group appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &ButtonGroupAppearance
appearance (read-only borrow; caller keeps the original; type &ButtonGroupAppearance)

Returns

int — a value of this type

($&Screen) set_button_group_item_enabled

XuAPI
pub fn (s $&Screen) set_button_group_item_enabled(id int,key int,enabled bool) int

Purpose

Operation on $&Screen: set button group item enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) set_button_group_label

XuAPI
pub fn (s $&Screen) set_button_group_label(id int,key int,label string) int

Purpose

Operation on $&Screen: set button group label. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)
label string
label (string)

Returns

int — a value of this type

($&Screen) set_button_group_checked

XuAPI
pub fn (s $&Screen) set_button_group_checked(id int,key int,selected bool) int

Purpose

Operation on $&Screen: set button group checked. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)
selected bool
selected (bool)

Returns

int — a value of this type

($&Screen) button_group_values

XuAPI
pub fn (s $&Screen) button_group_values(id int) []int

Purpose

Operation on $&Screen: button group values. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

[]int — slice result

($&Screen) button_group_active

XuAPI
pub fn (s $&Screen) button_group_active(id int) int

Purpose

Operation on $&Screen: button group active. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) chart_position

XuAPI
pub fn (s $&Screen) chart_position(id int,x f64,y f64) chart.ChartCoordinate

Purpose

Operation on $&Screen: chart position. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
x f64
value (f64)
y f64
value (f64)

Returns

chart.ChartCoordinate — a value of this type

($&Screen) chart_hit_test

XuAPI
pub fn (s $&Screen) chart_hit_test(id int,x f64,y f64) chart.ChartHit

Purpose

Operation on $&Screen: chart hit test. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
x f64
value (f64)
y f64
value (f64)

Returns

chart.ChartHit — a value of this type

($&Screen) remember_color

XuAPI
pub fn (s $&Screen) remember_color(id int) int

Purpose

Operation on $&Screen: remember color. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) set_tab_behavior

XuAPI
pub fn (s $&Screen) set_tab_behavior(id int,widths &[]f64,automatic bool) int

Purpose

Operation on $&Screen: set tab behavior. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
widths &[]f64
widths (read-only borrow; caller keeps the original; type &[]f64)
automatic bool
automatic (bool)

Returns

int — a value of this type

($&Screen) set_table_column

XuAPI
pub fn (s $&Screen) set_table_column(id int,column int,width f64,alignment f64) int

Purpose

Operation on $&Screen: set table column. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
column int
column (int)
width f64
width (f64)
alignment f64
alignment (f64)

Returns

int — a value of this type

($&Screen) set_table_status

XuAPI
pub fn (s $&Screen) set_table_status(id int,text string) int

Purpose

Operation on $&Screen: set table status. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
text string
text (string)

Returns

int — a value of this type

($&Screen) set_multi_filter

XuAPI
pub fn (s $&Screen) set_multi_filter(id int,query string) int

Purpose

Operation on $&Screen: set multi filter. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
query string
query (string)

Returns

int — a value of this type

($&Screen) select_all

XuAPI
pub fn (s $&Screen) select_all(id int,selected bool) int

Purpose

Operation on $&Screen: select all. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
selected bool
selected (bool)

Returns

int — a value of this type

($&Screen) set_date_options

XuAPI
pub fn (s $&Screen) set_date_options(id int,today time.Time,clearable bool) int

Purpose

Operation on $&Screen: set date options. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
today time.Time
today (time.Time)
clearable bool
clearable (bool)

Returns

int — a value of this type

($&Screen) clear_calendar

XuAPI
pub fn (s $&Screen) clear_calendar(id int) int

Purpose

Operation on $&Screen: clear calendar. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) set_clock_format

XuAPI
pub fn (s $&Screen) set_clock_format(id int,twelve_hour bool,seconds bool) int

Purpose

Operation on $&Screen: set clock format. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
twelve_hour bool
twelve_hour (bool)
seconds bool
seconds (bool)

Returns

int — a value of this type

($&Screen) set_color_hex

XuAPI
pub fn (s $&Screen) set_color_hex(id int,value string) int

Purpose

Operation on $&Screen: set color hex. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value string
value (string)

Returns

int — a value of this type

($&Screen) set_color_swatches

XuAPI
pub fn (s $&Screen) set_color_swatches(id int,colors &[]draw.Color) int

Purpose

Operation on $&Screen: set color swatches. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
colors &[]draw.Color
colors (read-only borrow; caller keeps the original; type &[]draw.Color)

Returns

int — a value of this type

($&Screen) set_stepper_repeat

XuAPI
pub fn (s $&Screen) set_stepper_repeat(id int,enabled bool,delay time.Duration,interval time.Duration) int

Purpose

Operation on $&Screen: set stepper repeat. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)
delay time.Duration
delay (time.Duration)
interval time.Duration
interval (time.Duration)

Returns

int — a value of this type

($&Screen) set_spinner_appearance

XuAPI
pub fn (s $&Screen) set_spinner_appearance(id int,diameter f64,thickness f64,period time.Duration) int

Purpose

Operation on $&Screen: set spinner appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
diameter f64
diameter (f64)
thickness f64
thickness (f64)
period time.Duration
period (time.Duration)

Returns

int — a value of this type

($&Screen) set_checkbox_indeterminate

XuAPI
pub fn (s $&Screen) set_checkbox_indeterminate(id int,mixed bool) int

Purpose

Operation on $&Screen: set checkbox indeterminate. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
mixed bool
mixed (bool)

Returns

int — a value of this type

($&Screen) set_badge_tone

XuAPI
pub fn (s $&Screen) set_badge_tone(id int,tone int) int

Purpose

Operation on $&Screen: set badge tone. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
tone int
tone (int)

Returns

int — a value of this type

($&Screen) set_progress_buffer

XuAPI
pub fn (s $&Screen) set_progress_buffer(id int,value f64) int

Purpose

Operation on $&Screen: set progress buffer. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value f64
value (f64)

Returns

int — a value of this type

($&Screen) color_hex

XuAPI
pub fn (s $&Screen) color_hex(id int) string

Purpose

Operation on $&Screen: color hex. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

string — result string

($&Screen) calendar_has_value

XuAPI
pub fn (s $&Screen) calendar_has_value(id int) bool

Purpose

Operation on $&Screen: calendar has value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

bool — true or false

($&Screen) text_field_area

XuAPI
pub fn (s $&Screen) text_field_area(value string,decoration &FieldDecoration) int

Purpose

Create FieldArea in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value string
value (string)
decoration &FieldDecoration
decoration (read-only borrow; caller keeps the original; type &FieldDecoration)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_task_feedback

XuAPI
pub fn (s $&Screen) set_task_feedback(id int,feedback &TaskFeedback) int

Purpose

Operation on $&Screen: set task feedback. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
feedback &TaskFeedback
feedback (read-only borrow; caller keeps the original; type &TaskFeedback)

Returns

int — a value of this type

($&Screen) set_select_option_enabled

XuAPI
pub fn (s $&Screen) set_select_option_enabled(id int,index int,enabled bool) int

Purpose

Operation on $&Screen: set select option enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
index int
index (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) set_combo_custom_values

XuAPI
pub fn (s $&Screen) set_combo_custom_values(id int,allowed bool) int

Purpose

Operation on $&Screen: set combo custom values. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
allowed bool
allowed (bool)

Returns

int — a value of this type

($&Screen) icon_button

XuAPI
pub fn (s $&Screen) icon_button(asset string,text string) int

Purpose

Create IconButton in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
asset string
asset (string)
text string
text (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) button_with_icon

XuAPI
pub fn (s $&Screen) button_with_icon(asset string,text string) int

Purpose

A visible image plus label, with normal Button focus, variants and actions. ControlStyle.icon_placement selects leading/trailing/above/below placement. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
asset string
asset (string)
text string
text (string)

Returns

int — a value of this type

($&Screen) measure_button

XuAPI
pub fn (s $&Screen) measure_button(id int) layout.Size

Purpose

Intrinsic size in Screen coordinates, including the current style, density, text scale and icon placement. Call again after changing any of those inputs. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

layout.Size — a value of this type

($&Screen) set_label_wrapped

XuAPI
pub fn (s $&Screen) set_label_wrapped(id int,wrapped bool) int

Purpose

Operation on $&Screen: set label wrapped. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
wrapped bool
wrapped (bool)

Returns

int — a value of this type

($&Screen) table

XuAPI
pub fn (s $&Screen) table(headers &[]string,rows int,selected int) int

Purpose

Create Table in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
headers &[]string
headers (read-only borrow; caller keeps the original; type &[]string)
rows int
rows (int)
selected int
selected (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) tree

XuAPI
pub fn (s $&Screen) tree() int

Purpose

Create TreeView in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — component node ID for place and other Screen methods.

($&Screen) pagination

XuAPI
pub fn (s $&Screen) pagination(pages int,current int) int

Purpose

Create Pagination in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
pages int
pages (int)
current int
current (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) breadcrumbs

XuAPI
pub fn (s $&Screen) breadcrumbs(items &[]string) int

Purpose

Create Breadcrumbs in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
items &[]string
items (read-only borrow; caller keeps the original; type &[]string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) combo_box

XuAPI
pub fn (s $&Screen) combo_box(options &[]string,value string) int

Purpose

Create ComboBox in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)
value string
value (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) multi_select

XuAPI
pub fn (s $&Screen) multi_select(options &[]string) int

Purpose

Create MultiSelect in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]string
options (read-only borrow; caller keeps the original; type &[]string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) color_picker

XuAPI
pub fn (s $&Screen) color_picker(value draw.Color) int

Purpose

Create ColorPicker in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value draw.Color
value (draw.Color)

Returns

int — component node ID for place and other Screen methods.

($&Screen) date_picker

XuAPI
pub fn (s $&Screen) date_picker(value time.Time) int

Purpose

Create DatePicker in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value time.Time
value (time.Time)

Returns

int — component node ID for place and other Screen methods.

($&Screen) time_picker

XuAPI
pub fn (s $&Screen) time_picker(value time.Time) int

Purpose

Create TimePicker in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value time.Time
value (time.Time)

Returns

int — component node ID for place and other Screen methods.

($&Screen) spinner

XuAPI
pub fn (s $&Screen) spinner() int

Purpose

Create Spinner in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — component node ID for place and other Screen methods.

($&Screen) input

XuAPI
pub fn (s $&Screen) input(value string) int

Purpose

Create Input in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value string
value (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) secret_input

XuAPI
pub fn (s $&Screen) secret_input(value string) int

Purpose

A secret input has the same editing behavior as input; tooling must redact its value and bounds. This flag follows the node for its entire lifetime. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value string
value (string)

Returns

int — a value of this type

($&Screen) set_secure

XuAPI
pub fn (s $&Screen) set_secure(id int,secure bool) int

Purpose

Mark password/secure controls (including application-defined controls) for screenshot and accessibility export redaction. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
secure bool
secure (bool)

Returns

int — a value of this type

($&Screen) text_area

XuAPI
pub fn (s $&Screen) text_area(value string) int

Purpose

Create TextArea in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value string
value (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_cell

XuAPI
pub fn (s $&Screen) set_cell(id int,row int,column int,value string) int

Purpose

Operation on $&Screen: set cell. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
row int
row (int)
column int
column (int)
value string
value (string)

Returns

int — a value of this type

($&Screen) sort_column

XuAPI
pub fn (s $&Screen) sort_column(id int) int

Purpose

Operation on $&Screen: sort column. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) sort_descending

XuAPI
pub fn (s $&Screen) sort_descending(id int) bool

Purpose

Operation on $&Screen: sort descending. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

bool — true or false

($&Screen) tree_add

XuAPI
pub fn (s $&Screen) tree_add(id int,parent int,value string) int

Purpose

Operation on $&Screen: tree add. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
parent int
parent (int)
value string
value (string)

Returns

int — a value of this type

($&Screen) set_expanded

XuAPI
pub fn (s $&Screen) set_expanded(id int,index int,expanded bool) int

Purpose

Operation on $&Screen: set expanded. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
index int
index (int)
expanded bool
expanded (bool)

Returns

int — a value of this type

($&Screen) selected

XuAPI
pub fn (s $&Screen) selected(id int) int

Purpose

Get or test the currently selected index, node, or state. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) set_selected

XuAPI
pub fn (s $&Screen) set_selected(id int,index int) int

Purpose

Operation on $&Screen: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
index int
index (int)

Returns

int — a value of this type

($&Screen) set_checked

XuAPI
pub fn (s $&Screen) set_checked(id int,index int,checked bool) int

Purpose

Operation on $&Screen: set checked. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
index int
index (int)
checked bool
checked (bool)

Returns

int — a value of this type

($&Screen) values

XuAPI
pub fn (s $&Screen) values(id int) []int

Purpose

Return a slice containing all values in the collection. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

[]int — slice result

($&Screen) text_value

XuAPI
pub fn (s $&Screen) text_value(id int) string

Purpose

Operation on $&Screen: text value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

string — result string

($&Screen) set_value

XuAPI
pub fn (s $&Screen) set_value(id int,value string) int

Purpose

Operation on $&Screen: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value string
value (string)

Returns

int — a value of this type

($&Screen) color_value

XuAPI
pub fn (s $&Screen) color_value(id int) draw.Color

Purpose

Operation on $&Screen: color value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

draw.Color — a value of this type

($&Screen) set_color_value

XuAPI
pub fn (s $&Screen) set_color_value(id int,value draw.Color) int

Purpose

Operation on $&Screen: set color value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value draw.Color
value (draw.Color)

Returns

int — a value of this type

($&Screen) calendar_value

XuAPI
pub fn (s $&Screen) calendar_value(id int) time.Time

Purpose

Operation on $&Screen: calendar value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

time.Time — a value of this type

($&Screen) set_calendar_value

XuAPI
pub fn (s $&Screen) set_calendar_value(id int,value time.Time) int

Purpose

Operation on $&Screen: set calendar value. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value time.Time
value (time.Time)

Returns

int — a value of this type

($&Screen) set_running

XuAPI
pub fn (s $&Screen) set_running(id int,running bool) int

Purpose

Operation on $&Screen: set running. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
running bool
running (bool)

Returns

int — a value of this type

($&Screen) set_page_count

XuAPI
pub fn (s $&Screen) set_page_count(id int,pages int) int

Purpose

Operation on $&Screen: set page count. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
pages int
pages (int)

Returns

int — a value of this type

($&Screen) set_date_range

XuAPI
pub fn (s $&Screen) set_date_range(id int,minimum time.Time,maximum time.Time) int

Purpose

Operation on $&Screen: set date range. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
minimum time.Time
minimum (time.Time)
maximum time.Time
maximum (time.Time)

Returns

int — a value of this type

($&Screen) set_copy_enabled

XuAPI
pub fn (s $&Screen) set_copy_enabled(id int,on bool) int

Purpose

Operation on $&Screen: set copy enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
on bool
on (bool)

Returns

int — a value of this type

(&Screen) is_copy_enabled

XuAPI
pub fn (s &Screen) is_copy_enabled(id int) bool

Purpose

Operation on &Screen: whether it is copy enabled.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

(&Screen) selected_text

XuAPI
pub fn (s &Screen) selected_text(id int) string

Purpose

Operation on &Screen: selected text.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

string — result string

($&Screen) set_control_style

XuAPI
pub fn (s $&Screen) set_control_style(id int,style &ControlStyle) int

Purpose

Full ControlStyle overrides remain intact across the Screen adapter. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Screen) set_button_variant

XuAPI
pub fn (s $&Screen) set_button_variant(id int,variant int) int

Purpose

Operation on $&Screen: set button variant. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
variant int
variant (int)

Returns

int — a value of this type

($&Screen) set_option_text

XuAPI
pub fn (s $&Screen) set_option_text(id int,index int,value string) int

Purpose

Operation on $&Screen: set option text. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
index int
index (int)
value string
value (string)

Returns

int — a value of this type

($&Screen) set_slider_commit_only

XuAPI
pub fn (s $&Screen) set_slider_commit_only(id int,enabled bool) int

Purpose

Operation on $&Screen: set slider commit only. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) set_motion

XuAPI
pub fn (s $&Screen) set_motion(id int,spec &MotionSpec) int

Purpose

Operation on $&Screen: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Screen) set_field_text_options

XuAPI
pub fn (s $&Screen) set_field_text_options(id int,options &FieldTextOptions) int

Purpose

Operation on $&Screen: set field text options. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
options &FieldTextOptions
options (read-only borrow; caller keeps the original; type &FieldTextOptions)

Returns

int — a value of this type

($&Screen) set_slider_appearance

XuAPI
pub fn (s $&Screen) set_slider_appearance(id int,appearance &SliderAppearance,step f64) int

Purpose

Operation on $&Screen: set slider appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &SliderAppearance
appearance (read-only borrow; caller keeps the original; type &SliderAppearance)
step f64
step (f64)

Returns

int — a value of this type

($&Screen) set_list_appearance

XuAPI
pub fn (s $&Screen) set_list_appearance(id int,appearance &ListAppearance) int

Purpose

Operation on $&Screen: set list appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &ListAppearance
appearance (read-only borrow; caller keeps the original; type &ListAppearance)

Returns

int — a value of this type

struct ActionDispatcher#C, S, A

XuAPI
pub struct ActionDispatcher#C, S, A {

}

Purpose

The table owns functions only. Context and target are borrowed for one call register named functions rather than closures retaining a target borrow. A callback returns "" on success or an error message. Catch throwing calls inside the callback: Xu function values do not carry an inferred throw ABI. C/S/A keep the function table fully typed; the factory infers them. Its ctx and target arguments select types only and are never retained. Screen and retained View loops use the same table; raw controls can supply local state.

Public fields

This type has no public fields.

action_dispatcher

XuAPI
pub fn action_dispatcher#C, S(ctx &C, target &S) ActionDispatcher#C, S, Action

Purpose

Action dispatcher.

Parameters

ctx &C
ctx (read-only borrow; caller keeps the original; type &C)
target &S
target (read-only borrow; caller keeps the original; type &S)

Returns

ActionDispatcher#C, S, Action — a value of this type

See usage example

($&ActionDispatcher#C, S, A) on

XuAPI
pub fn (d $&ActionDispatcher#C, S, A) on(id int, kind int, handler fn ($&C, $&S, &A) string) int

Purpose

Re-registering a key replaces its handler. Exact kind wins over on_any. Throws on failure; handle the error or propagate it to the caller.

Parameters

d $&ActionDispatcher#C, S, A
The ActionDispatcher#C, S, A instance used by this call (exclusive borrow).
id int
id (int)
kind int
kind tag (int)
handler fn ($&C, $&S, &A) string
handler (function value; type fn ($&C, $&S, &A) string)

Returns

int — a value of this type

($&ActionDispatcher#C, S, A) on_any

XuAPI
pub fn (d $&ActionDispatcher#C, S, A) on_any(id int, handler fn ($&C, $&S, &A) string) int

Purpose

on_any receives semantic actions only, never ACTION_NONE repaint signals. Throws on failure; handle the error or propagate it to the caller.

Parameters

d $&ActionDispatcher#C, S, A
The ActionDispatcher#C, S, A instance used by this call (exclusive borrow).
id int
id (int)
handler fn ($&C, $&S, &A) string
handler (function value; type fn ($&C, $&S, &A) string)

Returns

int — a value of this type

($&ActionDispatcher#C, S, A) set_fallback

XuAPI
pub fn (d $&ActionDispatcher#C, S, A) set_fallback(handler fn ($&C, $&S, &A) string)

Purpose

Optional compatibility callback; replacement follows the same rule as on.

Parameters

d $&ActionDispatcher#C, S, A
The ActionDispatcher#C, S, A instance used by this call (exclusive borrow).
handler fn ($&C, $&S, &A) string
handler (function value; type fn ($&C, $&S, &A) string)

Returns

This call does not return a value.

($&ActionDispatcher#C, S, A) clear_fallback

XuAPI
pub fn (d $&ActionDispatcher#C, S, A) clear_fallback()

Purpose

Operation on $&ActionDispatcher#C, S, A: clear fallback.

Parameters

d $&ActionDispatcher#C, S, A
The ActionDispatcher#C, S, A instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&ActionDispatcher#C, S, A) dispatch

XuAPI
pub fn (d &ActionDispatcher#C, S, A) dispatch(action &A, ctx $&C, s $&S) bool

Purpose

A miss/invalid action is false. Handler errors propagate and never fall back. Neither Screen nor context is stored in the table. Throws on failure; handle the error or propagate it to the caller.

Parameters

d &ActionDispatcher#C, S, A
The ActionDispatcher#C, S, A instance used by this call (borrow).
action &A
action (read-only borrow; caller keeps the original; type &A)
ctx $&C
ctx (exclusive borrow; may modify the original; type $&C)
s $&S
s (exclusive borrow; may modify the original; type $&S)

Returns

bool — true or false

(&ActionDispatcher#C, S, A) dispatch_or_fallback

XuAPI
pub fn (d &ActionDispatcher#C, S, A) dispatch_or_fallback(action &A, ctx $&C, s $&S) bool

Purpose

Shared by standard and custom loops: dispatch, then the optional fallback. Throws on failure; handle the error or propagate it to the caller.

Parameters

d &ActionDispatcher#C, S, A
The ActionDispatcher#C, S, A instance used by this call (borrow).
action &A
action (read-only borrow; caller keeps the original; type &A)
ctx $&C
ctx (exclusive borrow; may modify the original; type $&C)
s $&S
s (exclusive borrow; may modify the original; type $&S)

Returns

bool — true or false

run_screen_actions

XuAPI
pub fn run_screen_actions#C(s $&Screen, events chan ui.Event, ctx $&C, layout_fn fn ($&C, $&Screen) string, dispatcher &ActionDispatcher#C, Screen, Action) int

Purpose

Function-only entry point: context owns business state, layout is explicit, and a fallback is optional. Both paths dispose Screen on close or failure. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
s (exclusive borrow; may modify the original; type $&Screen)
events chan ui.Event
events (channel; type chan ui.Event)
ctx $&C
ctx (exclusive borrow; may modify the original; type $&C)
layout_fn fn ($&C, $&Screen) string
layout_fn (function value; type fn ($&C, $&Screen) string)
dispatcher &ActionDispatcher#C
dispatcher (read-only borrow; caller keeps the original; type &ActionDispatcher#C)
screen Screen
screen (Screen)
action Action
action (Action)

Returns

int — a value of this type

See usage example

($&Screen) clear_control_style

XuAPI
pub fn (s $&Screen) clear_control_style(id int) int

Purpose

Return an instance to inherited theme styling, including later theme changes. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

(&Screen) locale

XuAPI
pub fn (s &Screen) locale() Locale

Purpose

No process-global language: each Screen and explicit control override own a copy.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

Locale — a value of this type

($&Screen) control_locale

XuAPI
pub fn (s $&Screen) control_locale(id int) Locale

Purpose

Operation on $&Screen: control locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

Locale — a value of this type

($&Screen) set_locale

XuAPI
pub fn (s $&Screen) set_locale(locale &Locale) int

Purpose

Operation on $&Screen: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Screen) set_control_locale

XuAPI
pub fn (s $&Screen) set_control_locale(id int,locale &Locale) int

Purpose

Operation on $&Screen: set control locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&Screen) clear_control_locale

XuAPI
pub fn (s $&Screen) clear_control_locale(id int) int

Purpose

Operation on $&Screen: clear control locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) menu

XuAPI
pub fn (s $&Screen) menu(label string,items &[]MenuItem,mode int,primary_key int) int

Purpose

Create Menu / ContextMenu / SplitButton in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
label string
label (string)
items &[]MenuItem
items (read-only borrow; caller keeps the original; type &[]MenuItem)
mode int
mode (int)
primary_key int
primary_key (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) menu_checked

XuAPI
pub fn (s $&Screen) menu_checked(id int,key int) bool

Purpose

Operation on $&Screen: menu checked. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)

Returns

bool — true or false

($&Screen) set_menu_items

XuAPI
pub fn (s $&Screen) set_menu_items(id int,items &[]MenuItem) int

Purpose

Operation on $&Screen: set menu items. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
items &[]MenuItem
items (read-only borrow; caller keeps the original; type &[]MenuItem)

Returns

int — a value of this type

($&Screen) set_menu_label

XuAPI
pub fn (s $&Screen) set_menu_label(id int,label string) int

Purpose

Operation on $&Screen: set menu label. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
label string
label (string)

Returns

int — a value of this type

($&Screen) set_menu_item_label

XuAPI
pub fn (s $&Screen) set_menu_item_label(id int,key int,label string) int

Purpose

Operation on $&Screen: set menu item label. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)
label string
label (string)

Returns

int — a value of this type

($&Screen) set_menu_checked

XuAPI
pub fn (s $&Screen) set_menu_checked(id int,key int,checked bool) int

Purpose

Operation on $&Screen: set menu checked. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)
checked bool
checked (bool)

Returns

int — a value of this type

($&Screen) set_menu_item_enabled

XuAPI
pub fn (s $&Screen) set_menu_item_enabled(id int,key int,enabled bool) int

Purpose

Operation on $&Screen: set menu item enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
key int
key (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) set_menu_appearance

XuAPI
pub fn (s $&Screen) set_menu_appearance(id int,appearance &MenuAppearance) int

Purpose

Operation on $&Screen: set menu appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &MenuAppearance
appearance (read-only borrow; caller keeps the original; type &MenuAppearance)

Returns

int — a value of this type

($&Screen) set_menu_open

XuAPI
pub fn (s $&Screen) set_menu_open(id int,open bool) int

Purpose

Operation on $&Screen: set menu open. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
open bool
open (bool)

Returns

int — a value of this type

($&Screen) popover

XuAPI
pub fn (s $&Screen) popover(anchor int,text string) int

Purpose

Create Popover in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
anchor int
anchor (int)
text string
text (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) tooltip

XuAPI
pub fn (s $&Screen) tooltip(anchor int,text string) int

Purpose

Create Tooltip in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
anchor int
anchor (int)
text string
text (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) toast

XuAPI
pub fn (s $&Screen) toast(text string) int

Purpose

Execute toast on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)

Returns

int — a value of this type

($&Screen) notify

XuAPI
pub fn (s $&Screen) notify(text string) int

Purpose

Execute notify on $&Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)

Returns

int — a value of this type

($&Screen) modal

XuAPI
pub fn (s $&Screen) modal(title string,message string) int

Purpose

Create Modal in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
title string
title (string)
message string
message (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) open

XuAPI
pub fn (s $&Screen) open(id int) int

Purpose

Operation on $&Screen: open resource or establish connection. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) close_overlay

XuAPI
pub fn (s $&Screen) close_overlay(id int) int

Purpose

Operation on $&Screen: close overlay. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) show_toast

XuAPI
pub fn (s $&Screen) show_toast(id int,text string,duration time.Duration) int

Purpose

Operation on $&Screen: show toast. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
text string
text (string)
duration time.Duration
duration (time.Duration)

Returns

int — a value of this type

($&Screen) password_input

XuAPI
pub fn (s $&Screen) password_input(value string) int

Purpose

Create PasswordInput in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value string
value (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_password

XuAPI
pub fn (s $&Screen) set_password(id int,password bool) int

Purpose

Operation on $&Screen: set password. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
password bool
password (bool)

Returns

int — a value of this type

($&Screen) set_password_visible

XuAPI
pub fn (s $&Screen) set_password_visible(id int,visible bool) int

Purpose

Operation on $&Screen: set password visible. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
visible bool
visible (bool)

Returns

int — a value of this type

(&Screen) is_password

XuAPI
pub fn (s &Screen) is_password(id int) bool

Purpose

Operation on &Screen: whether it is password. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

(&Screen) is_password_visible

XuAPI
pub fn (s &Screen) is_password_visible(id int) bool

Purpose

Operation on &Screen: whether it is password visible. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

($&Screen) set_range_values

XuAPI
pub fn (s $&Screen) set_range_values(id int,lower f64,upper f64) int

Purpose

Operation on $&Screen: set range values. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
lower f64
lower (f64)
upper f64
upper (f64)

Returns

int — a value of this type

($&Screen) set_range_options

XuAPI
pub fn (s $&Screen) set_range_options(id int,options &RangeSliderOptions) int

Purpose

Operation on $&Screen: set range options. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
options &RangeSliderOptions
options (read-only borrow; caller keeps the original; type &RangeSliderOptions)

Returns

int — a value of this type

($&Screen) set_range_appearance

XuAPI
pub fn (s $&Screen) set_range_appearance(id int,appearance &SliderAppearance) int

Purpose

Operation on $&Screen: set range appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
appearance &SliderAppearance
appearance (read-only borrow; caller keeps the original; type &SliderAppearance)

Returns

int — a value of this type

($&Screen) range_values

XuAPI
pub fn (s $&Screen) range_values(id int) RangeValues

Purpose

Operation on $&Screen: range values. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

RangeValues — a value of this type

($&Screen) set_read_only

XuAPI
pub fn (s $&Screen) set_read_only(id int,value bool) int

Purpose

Operation on $&Screen: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
value bool
value (bool)

Returns

int — a value of this type

($&Screen) field

XuAPI
pub fn (s $&Screen) field(value string,decoration &FieldDecoration) int

Purpose

Create Field in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value string
value (string)
decoration &FieldDecoration
decoration (read-only borrow; caller keeps the original; type &FieldDecoration)

Returns

int — component node ID for place and other Screen methods.

($&Screen) task_button

XuAPI
pub fn (s $&Screen) task_button(label string) int

Purpose

Create TaskButton in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
label string
label (string)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_field_decoration

XuAPI
pub fn (s $&Screen) set_field_decoration(id int,decoration &FieldDecoration) int

Purpose

Operation on $&Screen: set field decoration. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
decoration &FieldDecoration
decoration (read-only borrow; caller keeps the original; type &FieldDecoration)

Returns

int — a value of this type

($&Screen) begin_task

XuAPI
pub fn (s $&Screen) begin_task(id int,task_id int) int

Purpose

Operation on $&Screen: begin task. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
task_id int
task_id (int)

Returns

int — a value of this type

($&Screen) set_task_progress

XuAPI
pub fn (s $&Screen) set_task_progress(id int,task_id int,value f64) bool

Purpose

Operation on $&Screen: set task progress. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
task_id int
task_id (int)
value f64
value (f64)

Returns

bool — true or false

($&Screen) complete_task

XuAPI
pub fn (s $&Screen) complete_task(id int,task_id int,state int) bool

Purpose

Operation on $&Screen: complete task. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
task_id int
task_id (int)
state int
state (int)

Returns

bool — true or false

($&Screen) set_task_progress_mode

XuAPI
pub fn (s $&Screen) set_task_progress_mode(id int,mode int) int

Purpose

Operation on $&Screen: set task progress mode. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
mode int
mode (int)

Returns

int — a value of this type

(&Scroll) axis

XuAPI
pub fn (scroll &Scroll) axis() int

Purpose

Execute axis on &Scroll.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

int — a value of this type

(&Scroll) content_bounds

XuAPI
pub fn (scroll &Scroll) content_bounds() layout.Rect

Purpose

Children occupy content coordinates; the rail stays outside their clip.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Screen) scroll_area

XuAPI
pub fn (s $&Screen) scroll_area(axis int,content_extent f64) int

Purpose

Create Scroll in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
axis int
axis (int)
content_extent f64
content_extent (f64)

Returns

int — component node ID for place and other Screen methods.

($&Screen) set_scroll_offset

XuAPI
pub fn (s $&Screen) set_scroll_offset(id int,offset f64) int

Purpose

Operation on $&Screen: set scroll offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
offset f64
offset (f64)

Returns

int — a value of this type

($&Screen) set_scroll_extent

XuAPI
pub fn (s $&Screen) set_scroll_extent(id int,extent f64) int

Purpose

Operation on $&Screen: set scroll extent. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
extent f64
extent (f64)

Returns

int — a value of this type

(&Screen) scroll_offset

XuAPI
pub fn (s &Screen) scroll_offset(id int) f64

Purpose

Operation on &Screen: scroll offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

f64 — a value of this type

($&Screen) selectable_text

XuAPI
pub fn (s $&Screen) selectable_text(text string,size f64,muted bool) int

Purpose

Operation on $&Screen: selectable text. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)
size f64
size (f64)
muted bool
muted (bool)

Returns

int — a value of this type

($&Screen) selectable_label

XuAPI
pub fn (s $&Screen) selectable_label(text string,size f64,muted bool) int

Purpose

Operation on $&Screen: selectable label. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
text string
text (string)
size f64
size (f64)
muted bool
muted (bool)

Returns

int — a value of this type

(&Screen) is_selectable_label

XuAPI
pub fn (s &Screen) is_selectable_label(id int) bool

Purpose

Operation on &Screen: whether it is selectable label.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

(&Screen) is_selectable

XuAPI
pub fn (s &Screen) is_selectable(id int) bool

Purpose

Operation on &Screen: whether it is selectable.

Parameters

s &Screen
The Screen instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

($&Screen) set_label_selectable

XuAPI
pub fn (s $&Screen) set_label_selectable(id int,selectable bool) int

Purpose

Operation on $&Screen: set label selectable. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
selectable bool
selectable (bool)

Returns

int — a value of this type

($&Screen) set_selectable

XuAPI
pub fn (s $&Screen) set_selectable(id int,selectable bool) int

Purpose

Operation on $&Screen: set selectable. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
selectable bool
selectable (bool)

Returns

int — a value of this type

($&Screen) split_pane

XuAPI
pub fn (s $&Screen) split_pane(id int,pane int) int

Purpose

Operation on $&Screen: split pane. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
pane int
pane (int)

Returns

int — a value of this type

($&Screen) split_layout

XuAPI
pub fn (s $&Screen) split_layout(id int) SplitLayout

Purpose

Returns current local pane geometry from the placed size, before painting. Parent business content under split_pane and size it using this query. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

SplitLayout — a value of this type

($&Screen) set_split_ratio

XuAPI
pub fn (s $&Screen) set_split_ratio(id int,ratio f64) int

Purpose

Operation on $&Screen: set split ratio. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
ratio f64
ratio (f64)

Returns

int — a value of this type

($&Screen) set_split_options

XuAPI
pub fn (s $&Screen) set_split_options(id int,options &SplitViewOptions) int

Purpose

Operation on $&Screen: set split options. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
options &SplitViewOptions
options (read-only borrow; caller keeps the original; type &SplitViewOptions)

Returns

int — a value of this type

($&Screen) set_split_collapsed

XuAPI
pub fn (s $&Screen) set_split_collapsed(id int,pane int,collapsed bool) int

Purpose

Operation on $&Screen: set split collapsed. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
pane int
pane (int)
collapsed bool
collapsed (bool)

Returns

int — a value of this type

struct Appearance

XuAPI
pub struct Appearance {
    pub styles Styles
    pub reduced_motion bool
}

Purpose

Appearance contains no event callbacks or business context. Applying it only updates style/motion state and invalidation; it does not dispatch actions.

Public fields

styles Styles
field (Styles)
reduced_motion bool
field (bool)

screen_appearance

XuAPI
pub fn screen_appearance(styles &Styles, reduced_motion bool) Appearance

Purpose

Screen appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
reduced_motion bool
reduced_motion (bool)

Returns

Appearance — a value of this type

See usage example

($&Screen) apply_appearance

XuAPI
pub fn (s $&Screen) apply_appearance(appearance &Appearance) int

Purpose

Operation on $&Screen: apply appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
appearance &Appearance
appearance (read-only borrow; caller keeps the original; type &Appearance)

Returns

int — a value of this type

($&Screen) sort_table

XuAPI
pub fn (s $&Screen) sort_table(id int,column int,descending bool) int

Purpose

Operation on $&Screen: sort table. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
column int
column (int)
descending bool
descending (bool)

Returns

int — a value of this type

($&Screen) set_table_sort_kind

XuAPI
pub fn (s $&Screen) set_table_sort_kind(id int,column int,kind int) int

Purpose

Operation on $&Screen: set table sort kind. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
column int
column (int)
kind int
kind tag (int)

Returns

int — a value of this type

($&Screen) set_table_local_sort

XuAPI
pub fn (s $&Screen) set_table_local_sort(id int,enabled bool) int

Purpose

Operation on $&Screen: set table local sort. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Screen) set_table_selected_row

XuAPI
pub fn (s $&Screen) set_table_selected_row(id int,row int) int

Purpose

Operation on $&Screen: set table selected row. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
row int
row (int)

Returns

int — a value of this type

($&Screen) set_table_rows

XuAPI
pub fn (s $&Screen) set_table_rows(id int,count int) int

Purpose

Operation on $&Screen: set table rows. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
count int
count (int)

Returns

int — a value of this type

($&Screen) table_row_at

XuAPI
pub fn (s $&Screen) table_row_at(id int,row int) int

Purpose

Operation on $&Screen: table row at. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
row int
row (int)

Returns

int — a value of this type

($&Screen) table_view_row

XuAPI
pub fn (s $&Screen) table_view_row(id int,row int) int

Purpose

Operation on $&Screen: table view row. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
row int
row (int)

Returns

int — a value of this type

($&Screen) table_selected_row

XuAPI
pub fn (s $&Screen) table_selected_row(id int) int

Purpose

Operation on $&Screen: table selected row. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&Screen) table_cell

XuAPI
pub fn (s $&Screen) table_cell(id int,row int,column int) string

Purpose

Operation on $&Screen: table cell. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
row int
row (int)
column int
column (int)

Returns

string — result string

($&Screen) table_view_cell

XuAPI
pub fn (s $&Screen) table_view_cell(id int,row int,column int) string

Purpose

Operation on $&Screen: table view cell. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
row int
row (int)
column int
column (int)

Returns

string — result string

($&Screen) set_invalid

XuAPI
pub fn (s $&Screen) set_invalid(id int,invalid bool) int

Purpose

Operation on $&Screen: set invalid. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
invalid bool
invalid (bool)

Returns

int — a value of this type

($&Screen) chart

XuAPI
pub fn (s $&Screen) chart() int

Purpose

Create Chart in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — component node ID for place and other Screen methods.

($&Screen) button_group

XuAPI
pub fn (s $&Screen) button_group(items &[]ButtonGroupItem,mode int) int

Purpose

Create ButtonGroup in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
items &[]ButtonGroupItem
items (read-only borrow; caller keeps the original; type &[]ButtonGroupItem)
mode int
mode (int)

Returns

int — component node ID for place and other Screen methods.

($&Screen) range_slider

XuAPI
pub fn (s $&Screen) range_slider(minimum f64,maximum f64,lower f64,upper f64) int

Purpose

Create RangeSlider in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
minimum f64
minimum (f64)
maximum f64
maximum (f64)
lower f64
lower (f64)
upper f64
upper (f64)

Returns

int — component node ID for place and other Screen methods.

($&Screen) split_view

XuAPI
pub fn (s $&Screen) split_view(ratio f64) int

Purpose

Create SplitView in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
ratio f64
ratio (f64)

Returns

int — component node ID for place and other Screen methods.

const ACTION_WEB_LOADING

XuAPI
pub const ACTION_WEB_LOADING = 30

Purpose

Constant ACTION_WEB_LOADING, defining protocol or algorithm parameters.

See usage example

const ACTION_WEB_LOADED

XuAPI
pub const ACTION_WEB_LOADED = 31

Purpose

Constant ACTION_WEB_LOADED, defining protocol or algorithm parameters.

See usage example

const ACTION_WEB_FAILED

XuAPI
pub const ACTION_WEB_FAILED = 32

Purpose

Constant ACTION_WEB_FAILED, defining protocol or algorithm parameters.

See usage example

const ACTION_WEB_PROGRESS

XuAPI
pub const ACTION_WEB_PROGRESS = 33

Purpose

Constant ACTION_WEB_PROGRESS, defining protocol or algorithm parameters.

See usage example

($&Screen) webview

XuAPI
pub fn (s $&Screen) webview() int

Purpose

Create WebView in Screen and return the component node ID; throw on creation failure.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).

Returns

int — component node ID for place and other Screen methods.

($&Screen) webview_native

XuAPI
pub fn (s $&Screen) webview_native(id int) ui.NativeView

Purpose

Bind this handle with webview.bind_native for the full WebView API. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

ui.NativeView — a value of this type

($&Screen) load_web_html

XuAPI
pub fn (s $&Screen) load_web_html(id int,html string) int

Purpose

Operation on $&Screen: load web html. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
html string
html (string)

Returns

int — a value of this type

($&Screen) load_web_url

XuAPI
pub fn (s $&Screen) load_web_url(id int,url string) int

Purpose

Operation on $&Screen: load web url. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
url string
url (string)

Returns

int — a value of this type

($&Screen) webview_command

XuAPI
pub fn (s $&Screen) webview_command(id int,command string) int

Purpose

Operation on $&Screen: webview command. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
command string
command (string)

Returns

int — a value of this type

($&Screen) set_webview_radius

XuAPI
pub fn (s $&Screen) set_webview_radius(id int,radius f64) int

Purpose

Operation on $&Screen: set webview radius. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
radius f64
radius (f64)

Returns

int — a value of this type

($&Screen) close_webview

XuAPI
pub fn (s $&Screen) close_webview(id int) int

Purpose

Explicit removal revokes copied native/WebView/request handles immediately. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

const AXIS_VERTICAL

XuAPI
pub const AXIS_VERTICAL = 0

Purpose

Constant AXIS_VERTICAL, defining protocol or algorithm parameters.

See usage example

const AXIS_HORIZONTAL

XuAPI
pub const AXIS_HORIZONTAL = 1

Purpose

Constant AXIS_HORIZONTAL, defining protocol or algorithm parameters.

See usage example

struct Scroll

XuAPI
pub struct Scroll {

}

Purpose

Scroll context or state structure.

Public fields

This type has no public fields.

See usage example

scroll

XuAPI
pub fn scroll(identity &ui.CanvasEvent,id int,bounds &layout.Rect,axis int,content_extent f64) Scroll

Purpose

Execute scroll. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
axis int
axis (int)
content_extent f64
content_extent (f64)

Returns

Scroll — a value of this type

See usage example

(&Scroll) offset

XuAPI
pub fn (scroll &Scroll) offset() f64

Purpose

Execute offset on &Scroll.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

f64 — a value of this type

(&Scroll) needs_paint

XuAPI
pub fn (scroll &Scroll) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

($&Scroll) painted

XuAPI
pub fn (scroll $&Scroll) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Scroll) set_focus

XuAPI
pub fn (scroll $&Scroll) set_focus(focused bool)

Purpose

Operation on $&Scroll: set focus.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Scroll) set_offset

XuAPI
pub fn (scroll $&Scroll) set_offset(offset f64) int

Purpose

Operation on $&Scroll: set offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
offset f64
offset (f64)

Returns

int — a value of this type

($&Scroll) set_content_extent

XuAPI
pub fn (scroll $&Scroll) set_content_extent(extent f64) int

Purpose

Operation on $&Scroll: set content extent. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
extent f64
extent (f64)

Returns

int — a value of this type

($&Scroll) set_bounds

XuAPI
pub fn (scroll $&Scroll) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Scroll: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Scroll) input

XuAPI
pub fn (scroll $&Scroll) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Scroll) event

XuAPI
pub fn (scroll $&Scroll) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Scroll) visible_items

XuAPI
pub fn (scroll &Scroll) visible_items(count int,item_extent f64,gap f64,overscan int) layout.VisibleRange

Purpose

Operation on &Scroll: visible items. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).
count int
count (int)
item_extent f64
item_extent (f64)
gap f64
gap (f64)
overscan int
overscan (int)

Returns

layout.VisibleRange — a value of this type

($&Scroll) layout_items

XuAPI
pub fn (scroll $&Scroll) layout_items(count int,item_extent f64,gap f64,overscan int) layout.VisibleRange

Purpose

Operation on $&Scroll: layout items. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
count int
count (int)
item_extent f64
item_extent (f64)
gap f64
gap (f64)
overscan int
overscan (int)

Returns

layout.VisibleRange — a value of this type

(&Scroll) begin

XuAPI
pub fn (scroll &Scroll) begin(frame $&draw.Frame) int

Purpose

Execute begin on &Scroll. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)

Returns

int — a value of this type

(&Scroll) end

XuAPI
pub fn (scroll &Scroll) end(frame $&draw.Frame) int

Purpose

Execute end on &Scroll. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)

Returns

int — a value of this type

struct FocusGroup

XuAPI
pub struct FocusGroup {

}

Purpose

FocusGroup context or state structure.

Public fields

This type has no public fields.

focus_group

XuAPI
pub fn focus_group(identity &ui.CanvasEvent,ids []int) FocusGroup

Purpose

Focus group. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
ids []int
ids ([]int)

Returns

FocusGroup — a value of this type

(&FocusGroup) current

XuAPI
pub fn (focus &FocusGroup) current() int

Purpose

Execute current on &FocusGroup.

Parameters

focus &FocusGroup
The FocusGroup instance used by this call (borrow).

Returns

int — a value of this type

($&FocusGroup) clear

XuAPI
pub fn (focus $&FocusGroup) clear()

Purpose

Clear all buffered or stored entries and internal state.

Parameters

focus $&FocusGroup
The FocusGroup instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&FocusGroup) focus

XuAPI
pub fn (focus $&FocusGroup) focus(id int) int

Purpose

Execute focus on $&FocusGroup. Throws on failure; handle the error or propagate it to the caller.

Parameters

focus $&FocusGroup
The FocusGroup instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&FocusGroup) input

XuAPI
pub fn (focus $&FocusGroup) input(input &ui.InputEvent) Action

Purpose

The owner registers only enabled, visible controls and applies the resulting identity to their set_focus methods. This preserves state across repaint/layout.

Parameters

focus $&FocusGroup
The FocusGroup instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&FocusGroup) set_items

XuAPI
pub fn (focus $&FocusGroup) set_items(ids []int) int

Purpose

Operation on $&FocusGroup: set items. Throws on failure; handle the error or propagate it to the caller.

Parameters

focus $&FocusGroup
The FocusGroup instance used by this call (exclusive borrow).
ids []int
ids ([]int)

Returns

int — a value of this type

($&FocusGroup) event

XuAPI
pub fn (focus $&FocusGroup) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

focus $&FocusGroup
The FocusGroup instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

(&Scroll) is_enabled

XuAPI
pub fn (scroll &Scroll) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

($&Scroll) set_enabled

XuAPI
pub fn (scroll $&Scroll) set_enabled(enabled bool)

Purpose

Operation on $&Scroll: set enabled.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&Scroll) id

XuAPI
pub fn (scroll &Scroll) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

int — a value of this type

(&Scroll) bounds

XuAPI
pub fn (scroll &Scroll) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Scroll) is_focused

XuAPI
pub fn (scroll &Scroll) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

(&Scroll) is_hovered

XuAPI
pub fn (scroll &Scroll) is_hovered() bool

Purpose

Operation on &Scroll: whether it is hovered.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

(&Scroll) is_dragging

XuAPI
pub fn (scroll &Scroll) is_dragging() bool

Purpose

Operation on &Scroll: whether it is dragging.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

(&Scroll) is_invalid

XuAPI
pub fn (scroll &Scroll) is_invalid() bool

Purpose

Operation on &Scroll: whether it is invalid.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

($&Scroll) set_invalid

XuAPI
pub fn (scroll $&Scroll) set_invalid(invalid bool)

Purpose

Operation on $&Scroll: set invalid.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

(&Scroll) visual_state

XuAPI
pub fn (scroll &Scroll) visual_state() int

Purpose

Operation on &Scroll: visual state.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

int — a value of this type

(&Scroll) has_style

XuAPI
pub fn (scroll &Scroll) has_style() bool

Purpose

Operation on &Scroll: whether it has style.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

bool — true or false

(&Scroll) style_or

XuAPI
pub fn (scroll &Scroll) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Scroll: style or.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Scroll) set_style

XuAPI
pub fn (scroll $&Scroll) set_style(style &ControlStyle) int

Purpose

Operation on $&Scroll: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Scroll) clear_style

XuAPI
pub fn (scroll $&Scroll) clear_style()

Purpose

Operation on $&Scroll: clear style.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Scroll) apply_styles

XuAPI
pub fn (scroll $&Scroll) apply_styles(styles &Styles) int

Purpose

Validate and apply styles, updating layout / geometry and repainting when metrics change.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

($&Scroll) measure_styled

XuAPI
pub fn (scroll $&Scroll) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&Scroll: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Scroll) scrollbar_track

XuAPI
pub fn (scroll &Scroll) scrollbar_track() layout.Rect

Purpose

Return the scrollbar track rectangle shared with hit testing.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

track in control coordinates

(&Scroll) scrollbar_thumb

XuAPI
pub fn (scroll &Scroll) scrollbar_thumb() layout.Rect

Purpose

Return the thumb rectangle from content extent, offset and minimum thumb size.

Parameters

scroll &Scroll
The Scroll instance used by this call (borrow).

Returns

thumb in control coordinates

($&Scroll) paint_scrollbar

XuAPI
pub fn (scroll $&Scroll) paint_scrollbar(frame $&draw.Frame,styles &Styles) int

Purpose

Paint the scrollbar and clear its dirty flag. Call after child content in overlay_styled.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

struct SelectOption

XuAPI
pub struct SelectOption {
    pub label string
    pub enabled bool
    pub group bool
}

Purpose

Structure encapsulating label, enabled, group.

Public fields

label string
field (string)
enabled bool
field (bool)
group bool
field (bool)

select_option

XuAPI
pub fn select_option(label string) SelectOption

Purpose

Select option.

Parameters

label string
label (string)

Returns

SelectOption — a value of this type

See usage example

select_group

XuAPI
pub fn select_group(label string) SelectOption

Purpose

Select group.

Parameters

label string
label (string)

Returns

SelectOption — a value of this type

See usage example

($&Select) set_option_group

XuAPI
pub fn (sel $&Select) set_option_group(index int,group bool) int

Purpose

Operation on $&Select: set option group. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
index int
index (int)
group bool
group (bool)

Returns

int — a value of this type

(&Select) is_group

XuAPI
pub fn (sel &Select) is_group(index int) bool

Purpose

Operation on &Select: whether it is group.

Parameters

sel &Select
The Select instance used by this call (borrow).
index int
index (int)

Returns

bool — true or false

($&Screen) select_options

XuAPI
pub fn (s $&Screen) select_options(options &[]SelectOption,selected int) int

Purpose

Operation on $&Screen: select options. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
options &[]SelectOption
options (read-only borrow; caller keeps the original; type &[]SelectOption)
selected int
selected (int)

Returns

int — a value of this type

struct SelectableText

XuAPI
pub struct SelectableText {

}

Purpose

SelectableText context or state structure.

Public fields

This type has no public fields.

selectable_text

XuAPI
pub fn selectable_text(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,text &string) SelectableText

Purpose

Selectable text. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

SelectableText — a value of this type

(&SelectableText) id

XuAPI
pub fn (s &SelectableText) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

int — a value of this type

(&SelectableText) identity

XuAPI
pub fn (s &SelectableText) identity() ui.CanvasEvent

Purpose

Execute identity on &SelectableText.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

ui.CanvasEvent — a value of this type

(&SelectableText) bounds

XuAPI
pub fn (s &SelectableText) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&SelectableText) text

XuAPI
pub fn (s &SelectableText) text() string

Purpose

Operation on &SelectableText: return the current text.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

string — result string

(&SelectableText) is_closed

XuAPI
pub fn (s &SelectableText) is_closed() bool

Purpose

Operation on &SelectableText: whether it is closed.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) is_focused

XuAPI
pub fn (s &SelectableText) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) is_selecting

XuAPI
pub fn (s &SelectableText) is_selecting() bool

Purpose

Operation on &SelectableText: whether it is selecting.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) is_hovered

XuAPI
pub fn (s &SelectableText) is_hovered() bool

Purpose

Operation on &SelectableText: whether it is hovered.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) is_enabled

XuAPI
pub fn (s &SelectableText) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) is_selectable

XuAPI
pub fn (s &SelectableText) is_selectable() bool

Purpose

Operation on &SelectableText: whether it is selectable.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) needs_paint

XuAPI
pub fn (s &SelectableText) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) has_popup_open

XuAPI
pub fn (s &SelectableText) has_popup_open() bool

Purpose

Operation on &SelectableText: whether it has popup open.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) popup_bounds

XuAPI
pub fn (s &SelectableText) popup_bounds() layout.Rect

Purpose

Operation on &SelectableText: popup bounds.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&SelectableText) cursor

XuAPI
pub fn (s &SelectableText) cursor() int

Purpose

Execute cursor on &SelectableText.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

int — a value of this type

(&SelectableText) has_selection

XuAPI
pub fn (s &SelectableText) has_selection() bool

Purpose

Operation on &SelectableText: whether it has selection.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) selection_range

XuAPI
pub fn (s &SelectableText) selection_range() ui.TextRange

Purpose

Operation on &SelectableText: selection range.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

ui.TextRange — a value of this type

(&SelectableText) selected_text

XuAPI
pub fn (s &SelectableText) selected_text() string

Purpose

Operation on &SelectableText: selected text.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

string — result string

($&SelectableText) painted

XuAPI
pub fn (s $&SelectableText) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SelectableText) close

XuAPI
pub fn (s $&SelectableText) close()

Purpose

Operation on $&SelectableText: close the resource.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SelectableText) dispose

XuAPI
pub fn (s $&SelectableText) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&SelectableText) clone_widget

XuAPI
pub fn (s &SelectableText) clone_widget() SelectableText

Purpose

Operation on &SelectableText: clone widget. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

SelectableText — a value of this type

($&SelectableText) set_bounds

XuAPI
pub fn (s $&SelectableText) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&SelectableText: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&SelectableText) set_text

XuAPI
pub fn (s $&SelectableText) set_text(text &string) int

Purpose

Operation on $&SelectableText: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&SelectableText) set_wrapped

XuAPI
pub fn (s $&SelectableText) set_wrapped(wrapped bool)

Purpose

Operation on $&SelectableText: set wrapped.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
wrapped bool
wrapped (bool)

Returns

This call does not return a value.

($&SelectableText) set_ellipsis

XuAPI
pub fn (s $&SelectableText) set_ellipsis(ellipsis bool)

Purpose

Operation on $&SelectableText: set ellipsis.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
ellipsis bool
ellipsis (bool)

Returns

This call does not return a value.

($&SelectableText) set_muted

XuAPI
pub fn (s $&SelectableText) set_muted(muted bool)

Purpose

Operation on $&SelectableText: set muted.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
muted bool
muted (bool)

Returns

This call does not return a value.

($&SelectableText) set_enabled

XuAPI
pub fn (s $&SelectableText) set_enabled(enabled bool)

Purpose

Operation on $&SelectableText: set enabled.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&SelectableText) set_selectable

XuAPI
pub fn (s $&SelectableText) set_selectable(selectable bool)

Purpose

Operation on $&SelectableText: set selectable.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&SelectableText) is_copy_enabled

XuAPI
pub fn (s &SelectableText) is_copy_enabled() bool

Purpose

Operation on &SelectableText: whether it is copy enabled.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

($&SelectableText) set_copy_enabled

XuAPI
pub fn (s $&SelectableText) set_copy_enabled(on bool)

Purpose

Operation on $&SelectableText: set copy enabled.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
on bool
on (bool)

Returns

This call does not return a value.

($&SelectableText) set_locale

XuAPI
pub fn (s $&SelectableText) set_locale(locale &Locale) int

Purpose

Operation on $&SelectableText: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&SelectableText) set_viewport

XuAPI
pub fn (s $&SelectableText) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&SelectableText: set viewport.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&SelectableText) select_all

XuAPI
pub fn (s $&SelectableText) select_all() bool

Purpose

Operation on $&SelectableText: select all.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

bool — true or false

($&SelectableText) clear_selection

XuAPI
pub fn (s $&SelectableText) clear_selection() bool

Purpose

Operation on $&SelectableText: clear selection.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

bool — true or false

($&SelectableText) set_selection

XuAPI
pub fn (s $&SelectableText) set_selection(start int,end int) bool

Purpose

Operation on $&SelectableText: set selection.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
start int
start (int)
end int
end (int)

Returns

bool — true or false

(&SelectableText) copy_selection

XuAPI
pub fn (s &SelectableText) copy_selection() int

Purpose

Operation on &SelectableText: copy selection.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

int — a value of this type

(&SelectableText) has_style

XuAPI
pub fn (s &SelectableText) has_style() bool

Purpose

Operation on &SelectableText: whether it has style.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).

Returns

bool — true or false

(&SelectableText) style_or

XuAPI
pub fn (s &SelectableText) style_or(styles &Styles) ControlStyle

Purpose

Operation on &SelectableText: style or.

Parameters

s &SelectableText
The SelectableText instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&SelectableText) set_style

XuAPI
pub fn (s $&SelectableText) set_style(style &ControlStyle) int

Purpose

Operation on $&SelectableText: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&SelectableText) clear_style

XuAPI
pub fn (s $&SelectableText) clear_style()

Purpose

Operation on $&SelectableText: clear style.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SelectableText) measure_styled

XuAPI
pub fn (s $&SelectableText) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&SelectableText: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&SelectableText) route

XuAPI
pub fn (s $&SelectableText) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&SelectableText) input

XuAPI
pub fn (s $&SelectableText) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&SelectableText) event

XuAPI
pub fn (s $&SelectableText) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&SelectableText) paint_styled

XuAPI
pub fn (s $&SelectableText) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&SelectableText: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&SelectableText) paint_popup_styled

XuAPI
pub fn (s $&SelectableText) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&SelectableText: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&SelectableText
The SelectableText instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Checkbox) set_motion

XuAPI
pub fn (control $&Checkbox) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Checkbox: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

control $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Radio) set_motion

XuAPI
pub fn (control $&Radio) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Radio: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

control $&Radio
The Radio instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&Checkbox) tick

XuAPI
pub fn (control $&Checkbox) tick(now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

control $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&Checkbox) next_tick

XuAPI
pub fn (control &Checkbox) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Checkbox: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

control &Checkbox
The Checkbox instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&Radio) tick

XuAPI
pub fn (control $&Radio) tick(now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

control $&Radio
The Radio instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&Radio) next_tick

XuAPI
pub fn (control &Radio) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Radio: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

control &Radio
The Radio instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

struct SliderAppearance

XuAPI
pub struct SliderAppearance {
    pub ticks int
    pub show_value bool
    pub decimals int
}

Purpose

Structure encapsulating ticks, show_value, decimals.

Public fields

ticks int
field (int)
show_value bool
field (bool)
decimals int
field (int)

slider_appearance

XuAPI
pub fn slider_appearance() SliderAppearance

Purpose

Slider appearance.

Parameters

No arguments are required.

Returns

SliderAppearance — a value of this type

See usage example

(&SliderAppearance) validate

XuAPI
pub fn (appearance &SliderAppearance) validate() int

Purpose

Execute validate on &SliderAppearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

appearance &SliderAppearance
The SliderAppearance instance used by this call (borrow).

Returns

int — a value of this type

($&Slider) set_appearance

XuAPI
pub fn (s $&Slider) set_appearance(appearance &SliderAppearance) int

Purpose

Operation on $&Slider: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
appearance &SliderAppearance
appearance (read-only borrow; caller keeps the original; type &SliderAppearance)

Returns

int — a value of this type

(&Slider) shows_value

XuAPI
pub fn (s &Slider) shows_value() bool

Purpose

Operation on &Slider: shows value.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

bool — true or false

(&Slider) value_text

XuAPI
pub fn (s &Slider) value_text() string

Purpose

Operation on &Slider: value text. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Slider
The Slider instance used by this call (borrow).

Returns

string — result string

(&Slider) paint_value_styled

XuAPI
pub fn (s &Slider) paint_value_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Slider: paint value styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

s &Slider
The Slider instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Spinner

XuAPI
pub struct Spinner {

}

Purpose

Spinner context or state structure.

Public fields

This type has no public fields.

spinner

XuAPI
pub fn spinner(bounds &layout.Rect) Spinner

Purpose

Execute spinner. Throws on failure; handle the error or propagate it to the caller.

Parameters

bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Spinner — a value of this type

(&Spinner) is_running

XuAPI
pub fn (spinner &Spinner) is_running() bool

Purpose

Operation on &Spinner: whether it is running.

Parameters

spinner &Spinner
The Spinner instance used by this call (borrow).

Returns

bool — true or false

(&Spinner) needs_paint

XuAPI
pub fn (spinner &Spinner) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

spinner &Spinner
The Spinner instance used by this call (borrow).

Returns

bool — true or false

(&Spinner) bounds

XuAPI
pub fn (spinner &Spinner) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

spinner &Spinner
The Spinner instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Spinner) set_bounds

XuAPI
pub fn (spinner $&Spinner) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Spinner: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Spinner) set_running

XuAPI
pub fn (spinner $&Spinner) set_running(running bool)

Purpose

Operation on $&Spinner: set running.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
running bool
running (bool)

Returns

This call does not return a value.

($&Spinner) set_enabled

XuAPI
pub fn (spinner $&Spinner) set_enabled(enabled bool)

Purpose

Operation on $&Spinner: set enabled.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Spinner) set_style

XuAPI
pub fn (spinner $&Spinner) set_style(style &ControlStyle) int

Purpose

Operation on $&Spinner: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

(&Spinner) style_or

XuAPI
pub fn (spinner &Spinner) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Spinner: style or.

Parameters

spinner &Spinner
The Spinner instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Spinner) tick

XuAPI
pub fn (spinner $&Spinner) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

(&Spinner) next_tick

XuAPI
pub fn (spinner &Spinner) next_tick(now time.Instant,reduced_motion bool) time.Instant

Purpose

Operation on &Spinner: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner &Spinner
The Spinner instance used by this call (borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

time.Instant — a value of this type

(&Spinner) measure_styled

XuAPI
pub fn (spinner &Spinner) measure_styled(styles &Styles) layout.Size

Purpose

Operation on &Spinner: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner &Spinner
The Spinner instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&Spinner) paint_styled

XuAPI
pub fn (spinner $&Spinner) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Spinner: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Spinner) set_appearance

XuAPI
pub fn (spinner $&Spinner) set_appearance(diameter f64,thickness f64,period time.Duration) int

Purpose

Operation on $&Spinner: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

spinner $&Spinner
The Spinner instance used by this call (exclusive borrow).
diameter f64
diameter (f64)
thickness f64
thickness (f64)
period time.Duration
period (time.Duration)

Returns

int — a value of this type

struct SplitViewOptions

XuAPI
pub struct SplitViewOptions {
    pub vertical bool
    pub minimum_first f64
    pub minimum_second f64
    pub handle_size f64
    pub keyboard_step f64
}

Purpose

Widgets Configuration parameters and options set.

Public fields

vertical bool
field (bool)
minimum_first f64
field (f64)
minimum_second f64
field (f64)
handle_size f64
field (f64)
keyboard_step f64
field (f64)

split_view_options

XuAPI
pub fn split_view_options() SplitViewOptions

Purpose

Split view options.

Parameters

No arguments are required.

Returns

SplitViewOptions — a value of this type

See usage example

struct SplitLayout

XuAPI
pub struct SplitLayout {
    pub first layout.Rect
    pub second layout.Rect
    pub handle layout.Rect
    pub ratio f64
    pub collapsed int
}

Purpose

Structure encapsulating first, second, handle, ratio, collapsed.

Public fields

first layout.Rect
field (layout.Rect)
second layout.Rect
field (layout.Rect)
handle layout.Rect
field (layout.Rect)
ratio f64
field (f64)
collapsed int
field (int)

struct SplitView

XuAPI
pub struct SplitView {

}

Purpose

SplitView context or state structure.

Public fields

This type has no public fields.

split_view

XuAPI
pub fn split_view(identity &ui.CanvasEvent,id int,bounds &layout.Rect,ratio f64) SplitView

Purpose

Split view. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
ratio f64
ratio (f64)

Returns

SplitView — a value of this type

(&SplitView) id

XuAPI
pub fn (v &SplitView) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).

Returns

int — a value of this type

(&SplitView) bounds

XuAPI
pub fn (v &SplitView) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&SplitView) value

XuAPI
pub fn (v &SplitView) value() f64

Purpose

Execute value on &SplitView.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).

Returns

f64 — a value of this type

(&SplitView) needs_paint

XuAPI
pub fn (v &SplitView) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).

Returns

bool — true or false

($&SplitView) painted

XuAPI
pub fn (v $&SplitView) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&SplitView) is_enabled

XuAPI
pub fn (v &SplitView) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).

Returns

bool — true or false

(&SplitView) geometry

XuAPI
pub fn (v &SplitView) geometry(bounds &layout.Rect,density f64) SplitLayout

Purpose

Execute geometry on &SplitView.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
density f64
density (f64)

Returns

SplitLayout — a value of this type

(&SplitView) layout

XuAPI
pub fn (v &SplitView) layout() SplitLayout

Purpose

Execute layout on &SplitView.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).

Returns

SplitLayout — a value of this type

($&SplitView) set_ratio

XuAPI
pub fn (v $&SplitView) set_ratio(value f64) int

Purpose

Operation on $&SplitView: set ratio. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
value f64
value (f64)

Returns

int — a value of this type

($&SplitView) set_collapsed

XuAPI
pub fn (v $&SplitView) set_collapsed(pane int,collapsed bool) int

Purpose

Collapse retains the requested ratio; expanding restores it under current minima. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
pane int
pane (int)
collapsed bool
collapsed (bool)

Returns

int — a value of this type

($&SplitView) set_options

XuAPI
pub fn (v $&SplitView) set_options(o &SplitViewOptions) int

Purpose

Operation on $&SplitView: set options. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
o &SplitViewOptions
o (read-only borrow; caller keeps the original; type &SplitViewOptions)

Returns

int — a value of this type

($&SplitView) cancel

XuAPI
pub fn (v $&SplitView) cancel()

Purpose

Execute cancel on $&SplitView.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SplitView) set_focus

XuAPI
pub fn (v $&SplitView) set_focus(value bool)

Purpose

Operation on $&SplitView: set focus.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&SplitView) set_enabled

XuAPI
pub fn (v $&SplitView) set_enabled(value bool)

Purpose

Operation on $&SplitView: set enabled.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&SplitView) set_read_only

XuAPI
pub fn (v $&SplitView) set_read_only(value bool)

Purpose

Operation on $&SplitView: set read only.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

This call does not return a value.

($&SplitView) set_bounds

XuAPI
pub fn (v $&SplitView) set_bounds(b &layout.Rect) int

Purpose

Operation on $&SplitView: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
b &layout.Rect
b (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&SplitView) set_style

XuAPI
pub fn (v $&SplitView) set_style(style &ControlStyle) int

Purpose

Operation on $&SplitView: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&SplitView) clear_style

XuAPI
pub fn (v $&SplitView) clear_style()

Purpose

Operation on $&SplitView: clear style.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SplitView) set_motion

XuAPI
pub fn (v $&SplitView) set_motion(spec &MotionSpec) int

Purpose

Operation on $&SplitView: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&SplitView) apply_styles

XuAPI
pub fn (v $&SplitView) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&SplitView) tick

XuAPI
pub fn (v $&SplitView) tick(styles &Styles,now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&SplitView) next_tick

XuAPI
pub fn (v &SplitView) next_tick(now time.Instant) time.Instant

Purpose

Operation on &SplitView: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

v &SplitView
The SplitView instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&SplitView) dispose

XuAPI
pub fn (v $&SplitView) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&SplitView) input

XuAPI
pub fn (v $&SplitView) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&SplitView) route

XuAPI
pub fn (v $&SplitView) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&SplitView) paint_styled

XuAPI
pub fn (v $&SplitView) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&SplitView: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

v $&SplitView
The SplitView instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

const PAINT_BACKGROUND

XuAPI
pub const PAINT_BACKGROUND = 1

Purpose

Constant PAINT_BACKGROUND, defining protocol or algorithm parameters.

const PAINT_FOREGROUND

XuAPI
pub const PAINT_FOREGROUND = 2

Purpose

Constant PAINT_FOREGROUND, defining protocol or algorithm parameters.

See usage example

const PAINT_BORDER

XuAPI
pub const PAINT_BORDER = 4

Purpose

Constant PAINT_BORDER, defining protocol or algorithm parameters.

See usage example

const PAINT_FOCUS

XuAPI
pub const PAINT_FOCUS = 8

Purpose

Constant PAINT_FOCUS, defining protocol or algorithm parameters.

const PAINT_SELECTION

XuAPI
pub const PAINT_SELECTION = 16

Purpose

Constant PAINT_SELECTION, defining protocol or algorithm parameters.

const PAINT_SELECTION_TEXT

XuAPI
pub const PAINT_SELECTION_TEXT = 32

Purpose

Constant PAINT_SELECTION_TEXT, defining protocol or algorithm parameters.

const PAINT_PLACEHOLDER

XuAPI
pub const PAINT_PLACEHOLDER = 64

Purpose

Constant PAINT_PLACEHOLDER, defining protocol or algorithm parameters.

const PAINT_ICON_OPACITY

XuAPI
pub const PAINT_ICON_OPACITY = 128

Purpose

Constant PAINT_ICON_OPACITY, defining protocol or algorithm parameters.

struct StatePaint

XuAPI
pub struct StatePaint {
    pub when int
    pub unless int
    pub fields int
    pub background draw.Color
    pub foreground draw.Color
    pub border draw.Color
    pub focus draw.Color
    pub selection draw.Color
    pub selection_text draw.Color
    pub placeholder draw.Color
    pub icon_opacity f64
}

Purpose

Selective combined-state override. Matches all when bits and no unless bits; rules apply in array order, with later overrides winning.

Public fields

when int
required state bits, 0–127
unless int
excluded state bits; cannot overlap when
fields int
paint_* mask, 0–255; only selected fields change
background draw.Color
field (draw.Color)
foreground draw.Color
field (draw.Color)
border draw.Color
field (draw.Color)
focus draw.Color
field (draw.Color)
selection draw.Color
field (draw.Color)
selection_text draw.Color
field (draw.Color)
placeholder draw.Color
field (draw.Color)
icon_opacity f64
absolute resolved opacity, 0–1

state_paint

XuAPI
pub fn state_paint(when int) StatePaint

Purpose

Create a rule with when and fields=0. Select paint_* bits to activate the corresponding overrides.

Parameters

when int
required combined-state bits

Returns

a rule ready for customization

See usage example

struct ResolvedStyle

XuAPI
pub struct ResolvedStyle {
    pub background draw.Color
    pub foreground draw.Color
    pub border draw.Color
    pub focus draw.Color
    pub selection draw.Color
    pub selection_text draw.Color
    pub placeholder draw.Color
    pub icon_opacity f64
}

Purpose

Structure encapsulating background, foreground, border, focus, selection.

Public fields

background draw.Color
field (draw.Color)
foreground draw.Color
field (draw.Color)
border draw.Color
field (draw.Color)
focus draw.Color
field (draw.Color)
selection draw.Color
field (draw.Color)
selection_text draw.Color
field (draw.Color)
placeholder draw.Color
field (draw.Color)
icon_opacity f64
field (f64)

(&ControlStyle) resolve

XuAPI
pub fn (c &ControlStyle) resolve(state int) ResolvedStyle

Purpose

Resolve combined states using the base palette and ordered rules without mutating the control.

Parameters

c &ControlStyle
The ControlStyle instance used by this call (borrow).
state int
state (int)

Returns

resolved colors and icon opacity

const STATE_DISABLED

XuAPI
pub const STATE_DISABLED = 1

Purpose

Constant STATE_DISABLED, defining protocol or algorithm parameters.

See usage example

const STATE_HOVERED

XuAPI
pub const STATE_HOVERED = 2

Purpose

Constant STATE_HOVERED, defining protocol or algorithm parameters.

See usage example

const STATE_PRESSED

XuAPI
pub const STATE_PRESSED = 4

Purpose

Constant STATE_PRESSED, defining protocol or algorithm parameters.

const STATE_FOCUSED

XuAPI
pub const STATE_FOCUSED = 8

Purpose

Constant STATE_FOCUSED, defining protocol or algorithm parameters.

See usage example

const STATE_SELECTED

XuAPI
pub const STATE_SELECTED = 16

Purpose

Constant STATE_SELECTED, defining protocol or algorithm parameters.

const STATE_INVALID

XuAPI
pub const STATE_INVALID = 32

Purpose

Constant STATE_INVALID, defining protocol or algorithm parameters.

See usage example

const STATE_READ_ONLY

XuAPI
pub const STATE_READ_ONLY = 64

Purpose

Constant STATE_READ_ONLY, defining protocol or algorithm parameters.

See usage example

const ICON_LEADING

XuAPI
pub const ICON_LEADING = 0

Purpose

Constant ICON_LEADING, defining protocol or algorithm parameters.

See usage example

const ICON_TRAILING

XuAPI
pub const ICON_TRAILING = 1

Purpose

Constant ICON_TRAILING, defining protocol or algorithm parameters.

See usage example

const ICON_ABOVE

XuAPI
pub const ICON_ABOVE = 2

Purpose

Constant ICON_ABOVE, defining protocol or algorithm parameters.

See usage example

const ICON_BELOW

XuAPI
pub const ICON_BELOW = 3

Purpose

Constant ICON_BELOW, defining protocol or algorithm parameters.

See usage example

struct FontStyle

XuAPI
pub struct FontStyle {
    pub family string
    pub size f64
    pub weight int
    pub italic bool
    pub line_height f64
}

Purpose

Font configuration. Empty family selects the system font; size and line_height use logical pixels.

Public fields

family string
UTF-8 family, at most 256 bytes without NUL; empty selects system font
size f64
base size, 1–512; scaled size must remain in range
weight int
weight, 100–900
italic bool
italic face
line_height f64
0 selects default; explicit value must be at least size and at most 1024

font_style

XuAPI
pub fn font_style(size f64) FontStyle

Purpose

Font style.

Parameters

size f64
size (f64)

Returns

FontStyle — a value of this type

struct Palette

XuAPI
pub struct Palette {
    pub normal draw.Color
    pub hovered draw.Color
    pub pressed draw.Color
    pub disabled draw.Color
    pub foreground draw.Color
    pub muted draw.Color
    pub accent draw.Color
    pub on_accent draw.Color
    pub focus draw.Color
    pub border draw.Color
    pub invalid draw.Color
    pub invalid_fill draw.Color
    pub read_only draw.Color
    pub selection draw.Color
    pub selection_text draw.Color
    pub placeholder draw.Color
}

Purpose

Base state palette. Background precedence: disabled, invalid, read-only, selected, pressed, hovered, normal.

Public fields

normal draw.Color
normal background
hovered draw.Color
hover background
pressed draw.Color
pressed background
disabled draw.Color
disabled background
foreground draw.Color
normal foreground
muted draw.Color
disabled foreground
accent draw.Color
selected background and progress indicator
on_accent draw.Color
selected foreground
focus draw.Color
focus ring
border draw.Color
normal border
invalid draw.Color
invalid border and progress indicator
invalid_fill draw.Color
invalid background
read_only draw.Color
read-only background
selection draw.Color
text selection background
selection_text draw.Color
text selection foreground
placeholder draw.Color
placeholder text

struct ControlStyle

XuAPI
pub struct ControlStyle {
    pub palette Palette
    pub font FontStyle
    pub inherit_font bool
    pub padding layout.Insets
    pub radius f64
    pub border_width f64
    pub focus_width f64
    pub focus_inset f64
    pub min_width f64
    pub min_height f64
    pub gap f64
    pub indicator_size f64
    pub mark_width f64
    pub caret_width f64
    pub preedit_width f64
    pub shadow_x f64
    pub shadow_y f64
    pub shadow_spread f64
    pub shadow_blur f64
    pub align_x f64
    pub align_y f64
    pub icon_size f64
    pub icon_placement int
    pub icon_opacity f64
    pub disabled_icon_opacity f64
    pub shadow draw.Color
    pub states []StatePaint
}

Purpose

Control colors, typography and geometry. Metrics are finite and nonnegative; offsets may be negative. clone deep-copies the rule array.

Public fields

palette Palette
base state colors
font FontStyle
local control font
inherit_font bool
true inherits Styles.font; false uses the local font
padding layout.Insets
content padding scaled by density
radius f64
corner radius scaled by density
border_width f64
border width scaled by density
focus_width f64
focus-ring width; 0 hides it
focus_inset f64
focus-ring inset
min_width f64
minimum logical width
min_height f64
minimum logical height; minimum thumb length for Scroll
gap f64
spacing between text, icons or indicators
indicator_size f64
checkbox indicator size or scrollbar thickness
mark_width f64
checkbox mark stroke width
caret_width f64
editor caret width
preedit_width f64
preedit underline width
shadow_x f64
horizontal shadow offset
shadow_y f64
vertical shadow offset
shadow_spread f64
shadow spread radius
shadow_blur f64
blur radius for the at-most-eight-layer approximation
align_x f64
horizontal alignment, 0–1
align_y f64
vertical alignment, 0–1
icon_size f64
image icon square size; 0 removes icon spacing
icon_placement int
icon_leading / trailing / above / below
icon_opacity f64
icon opacity, 0–1
disabled_icon_opacity f64
additional disabled opacity multiplier, 0–1
shadow draw.Color
shadow color; transparent disables shadow
states []StatePaint
up to 32 rules; later matching field overrides win

See usage example

struct Styles

XuAPI
pub struct Styles {
    pub font FontStyle
    pub text_scale f64
    pub density f64
    pub background draw.Color
    pub button ControlStyle
    pub checkbox ControlStyle
    pub input ControlStyle
    pub text_area ControlStyle
    pub progress ControlStyle
    pub scroll ControlStyle
}

Purpose

Complete control theme with independent text scaling and geometry density. Start with a factory, customize and validate.

Public fields

font FontStyle
global font for controls with inherit_font=true
text_scale f64
text scale, 0.5–4.0
density f64
geometry scale, 0.5–4.0; does not scale text
background draw.Color
View background; must be opaque when presenting
button ControlStyle
button style
checkbox ControlStyle
checkbox style
input ControlStyle
single-line editor style
text_area ControlStyle
multiline editor style
progress ControlStyle
progress style
scroll ControlStyle
scrollbar style

See usage example

dark_styles

XuAPI
pub fn dark_styles() Styles

Purpose

Create a complete dark theme; applications control subsequent switching.

Parameters

No arguments are required.

Returns

an owned Styles value

See usage example

light_styles

XuAPI
pub fn light_styles() Styles

Purpose

Create a complete light theme; applications control subsequent switching.

Parameters

No arguments are required.

Returns

an owned Styles value

See usage example

contrast_styles

XuAPI
pub fn contrast_styles() Styles

Purpose

Create a complete high-contrast theme; applications control subsequent switching.

Parameters

No arguments are required.

Returns

an owned Styles value

(&Styles) same_as

XuAPI
pub fn (styles &Styles) same_as(other &Styles) bool

Purpose

Compare the complete theme, including state rules.

Parameters

styles &Styles
The Styles instance used by this call (borrow).
other &Styles
the other value of the same type (read-only borrow; caller keeps the original; type &Styles)

Returns

whether all style fields match

(&Styles) same_metrics

XuAPI
pub fn (styles &Styles) same_metrics(other &Styles) bool

Purpose

Compare fields affecting typography and geometry measurement; colors and decorations are excluded.

Parameters

styles &Styles
The Styles instance used by this call (borrow).
other &Styles
the other value of the same type (read-only borrow; caller keeps the original; type &Styles)

Returns

whether measurement metrics match

(&Styles) validate

XuAPI
pub fn (styles &Styles) validate() int

Purpose

Validate fonts, text scale, density, geometry and state rules; throws on invalid values.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

0 on success; throws on failure

(&Styles) text_options

XuAPI
pub fn (styles &Styles) text_options(control &ControlStyle) draw.TextOptions

Purpose

Operation on &Styles: text options.

Parameters

styles &Styles
The Styles instance used by this call (borrow).
control &ControlStyle
control (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

draw.TextOptions — a value of this type

rounded_fill

XuAPI
pub fn rounded_fill(frame $&draw.Frame,bounds &layout.Rect,radius f64,color draw.Color) int

Purpose

Rounded fill. Throws on failure; handle the error or propagate it to the caller.

Parameters

frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
radius f64
radius (f64)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

style_box

XuAPI
pub fn style_box(frame $&draw.Frame,bounds &layout.Rect,style &ControlStyle,density f64,state int) int

Purpose

Style box. Throws on failure; handle the error or propagate it to the caller.

Parameters

frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)
density f64
density (f64)
state int
state (int)

Returns

int — a value of this type

(&FontStyle) validate

XuAPI
pub fn (font &FontStyle) validate() int

Purpose

Execute validate on &FontStyle. Throws on failure; handle the error or propagate it to the caller.

Parameters

font &FontStyle
The FontStyle instance used by this call (borrow).

Returns

int — a value of this type

(&ControlStyle) validate

XuAPI
pub fn (c &ControlStyle) validate() int

Purpose

Execute validate on &ControlStyle. Throws on failure; handle the error or propagate it to the caller.

Parameters

c &ControlStyle
The ControlStyle instance used by this call (borrow).

Returns

int — a value of this type

(&ControlStyle) same_as

XuAPI
pub fn (c &ControlStyle) same_as(other &ControlStyle) bool

Purpose

Operation on &ControlStyle: same as.

Parameters

c &ControlStyle
The ControlStyle instance used by this call (borrow).
other &ControlStyle
the other value of the same type (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

bool — true or false

(&ControlStyle) same_metrics

XuAPI
pub fn (c &ControlStyle) same_metrics(other &ControlStyle) bool

Purpose

Operation on &ControlStyle: same metrics.

Parameters

c &ControlStyle
The ControlStyle instance used by this call (borrow).
other &ControlStyle
the other value of the same type (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

bool — true or false

paint_box_styled

XuAPI
pub fn paint_box_styled(frame $&draw.Frame,bounds &layout.Rect,styles &Styles,control &ControlStyle,state int) int

Purpose

Paint box styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
control &ControlStyle
control (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)

Returns

int — a value of this type

struct StyledLabel

XuAPI
pub struct StyledLabel {

}

Purpose

Owned text and native layout cache. Palette changes reuse layout; font changes rebuild it. Dispose when finished.

Public fields

This type has no public fields.

See usage example

styled_label

XuAPI
pub fn styled_label(context &draw.Context,value &string) StyledLabel

Purpose

Styled label.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

StyledLabel — a value of this type

See usage example

($&StyledLabel) set_font_stack

XuAPI
pub fn (label $&StyledLabel) set_font_stack(stack font.FontStack)

Purpose

Operation on $&StyledLabel: set font stack.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
stack font.FontStack
stack (font.FontStack)

Returns

This call does not return a value.

($&StyledLabel) add_ttf_bytes

XuAPI
pub fn (label $&StyledLabel) add_ttf_bytes(ttf_bytes &[]u8,font_index int,face_id int) int

Purpose

Operation on $&StyledLabel: add ttf bytes. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
ttf_bytes &[]u8
ttf_bytes (read-only borrow; caller keeps the original; type &[]u8)
font_index int
font_index (int)
face_id int
face_id (int)

Returns

int — a value of this type

(&StyledLabel) paint_layout_at

XuAPI
pub fn (label &StyledLabel) paint_layout_at(frame $&draw.Frame,shaped &draw.TextLayout,x f64,y f64,color draw.Color) int

Purpose

Operation on &StyledLabel: paint layout at. Throws on failure; handle the error or propagate it to the caller.

Parameters

label &StyledLabel
The StyledLabel instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
shaped &draw.TextLayout
shaped (read-only borrow; caller keeps the original; type &draw.TextLayout)
x f64
value (f64)
y f64
value (f64)
color draw.Color
color (draw.Color)

Returns

int — a value of this type

(&StyledLabel) text

XuAPI
pub fn (label &StyledLabel) text() string

Purpose

Operation on &StyledLabel: return the current text.

Parameters

label &StyledLabel
The StyledLabel instance used by this call (borrow).

Returns

string — result string

(&StyledLabel) has_style

XuAPI
pub fn (label &StyledLabel) has_style() bool

Purpose

Operation on &StyledLabel: whether it has style.

Parameters

label &StyledLabel
The StyledLabel instance used by this call (borrow).

Returns

bool — true or false

(&StyledLabel) style_or

XuAPI
pub fn (label &StyledLabel) style_or(fallback &ControlStyle) ControlStyle

Purpose

Operation on &StyledLabel: style or.

Parameters

label &StyledLabel
The StyledLabel instance used by this call (borrow).
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

ControlStyle — a value of this type

($&StyledLabel) set_style

XuAPI
pub fn (label $&StyledLabel) set_style(style &ControlStyle) int

Purpose

Operation on $&StyledLabel: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&StyledLabel) clear_style

XuAPI
pub fn (label $&StyledLabel) clear_style()

Purpose

Operation on $&StyledLabel: clear style.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&StyledLabel) set_text

XuAPI
pub fn (label $&StyledLabel) set_text(value &string)

Purpose

Replace owned text; also call View.mark_measure when used in a View.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
value &string
value (read-only borrow; caller keeps the original; type &string)

Returns

This call does not return a value.

($&StyledLabel) measure_styled

XuAPI
pub fn (label $&StyledLabel) measure_styled(styles &Styles,control &ControlStyle) layout.Size

Purpose

Measure StyledLabel with the effective font, density, content and minimum size.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
control &ControlStyle
control (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

intrinsic logical size; throws if native shaping fails

($&StyledLabel) measure_wrapped

XuAPI
pub fn (label $&StyledLabel) measure_wrapped(styles &Styles,control &ControlStyle,width f64) layout.Size

Purpose

Operation on $&StyledLabel: measure wrapped. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
control &ControlStyle
control (read-only borrow; caller keeps the original; type &ControlStyle)
width f64
width (f64)

Returns

layout.Size — a value of this type

($&StyledLabel) measure_box_styled

XuAPI
pub fn (label $&StyledLabel) measure_box_styled(styles &Styles,fallback &ControlStyle) layout.Size

Purpose

Operation on $&StyledLabel: measure box styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

layout.Size — a value of this type

($&StyledLabel) paint_text_styled

XuAPI
pub fn (label $&StyledLabel) paint_text_styled(frame $&draw.Frame,bounds &layout.Rect,styles &Styles,fallback &ControlStyle,state int) int

Purpose

Operation on $&StyledLabel: paint text styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)

Returns

int — a value of this type

($&StyledLabel) paint_styled

XuAPI
pub fn (label $&StyledLabel) paint_styled(frame $&draw.Frame,bounds &layout.Rect,styles &Styles,fallback &ControlStyle,state int) int

Purpose

Operation on $&StyledLabel: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)

Returns

int — a value of this type

($&StyledLabel) dispose

XuAPI
pub fn (label $&StyledLabel) dispose()

Purpose

Release the native layout cache owned by the label.

Parameters

label $&StyledLabel
The StyledLabel instance used by this call (exclusive borrow).

Returns

This call does not return a value.

copy_font

XuAPI
pub fn copy_font(font &FontStyle) FontStyle

Purpose

Copy font.

Parameters

font &FontStyle
font (read-only borrow; caller keeps the original; type &FontStyle)

Returns

FontStyle — a value of this type

(&ControlStyle) clone

XuAPI
pub fn (c &ControlStyle) clone() ControlStyle

Purpose

Deep-copy the control style and state-rule array.

Parameters

c &ControlStyle
The ControlStyle instance used by this call (borrow).

Returns

an owned ControlStyle

(&Styles) clone

XuAPI
pub fn (s &Styles) clone() Styles

Purpose

Deep-copy the theme, including each control state-rule array.

Parameters

s &Styles
The Styles instance used by this call (borrow).

Returns

an owned Styles

(&Styles) switch_style

XuAPI
pub fn (styles &Styles) switch_style() ControlStyle

Purpose

Operation on &Styles: switch style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) radio_style

XuAPI
pub fn (styles &Styles) radio_style() ControlStyle

Purpose

Operation on &Styles: radio style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) slider_style

XuAPI
pub fn (styles &Styles) slider_style() ControlStyle

Purpose

Operation on &Styles: slider style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) tabs_style

XuAPI
pub fn (styles &Styles) tabs_style() ControlStyle

Purpose

Operation on &Styles: tabs style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) select_style

XuAPI
pub fn (styles &Styles) select_style() ControlStyle

Purpose

Operation on &Styles: select style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) divider_style

XuAPI
pub fn (styles &Styles) divider_style() ControlStyle

Purpose

Operation on &Styles: divider style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) badge_style

XuAPI
pub fn (styles &Styles) badge_style() ControlStyle

Purpose

Operation on &Styles: badge style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) card_style

XuAPI
pub fn (styles &Styles) card_style() ControlStyle

Purpose

Operation on &Styles: card style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) stepper_style

XuAPI
pub fn (styles &Styles) stepper_style() ControlStyle

Purpose

Operation on &Styles: stepper style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) list_box_style

XuAPI
pub fn (styles &Styles) list_box_style() ControlStyle

Purpose

Operation on &Styles: list box style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Styles) menu_style

XuAPI
pub fn (styles &Styles) menu_style() ControlStyle

Purpose

Operation on &Styles: menu style.

Parameters

styles &Styles
The Styles instance used by this call (borrow).

Returns

ControlStyle — a value of this type

(&Button) visual_state

XuAPI
pub fn (button &Button) visual_state() int

Purpose

Operation on &Button: visual state.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

int — a value of this type

(&Button) has_style

XuAPI
pub fn (button &Button) has_style() bool

Purpose

Operation on &Button: whether it has style.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) style_or

XuAPI
pub fn (button &Button) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Button: style or.

Parameters

button &Button
The Button instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Button) set_style

XuAPI
pub fn (button $&Button) set_style(style &ControlStyle) int

Purpose

Operation on $&Button: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Button) clear_style

XuAPI
pub fn (button $&Button) clear_style()

Purpose

Operation on $&Button: clear style.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Button) is_invalid

XuAPI
pub fn (button &Button) is_invalid() bool

Purpose

Operation on &Button: whether it is invalid.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_selected

XuAPI
pub fn (button &Button) is_selected() bool

Purpose

Operation on &Button: whether it is selected.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_read_only

XuAPI
pub fn (button &Button) is_read_only() bool

Purpose

Operation on &Button: whether it is read only.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_hovered

XuAPI
pub fn (button &Button) is_hovered() bool

Purpose

Operation on &Button: whether it is hovered.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

(&Button) is_pressed

XuAPI
pub fn (button &Button) is_pressed() bool

Purpose

Operation on &Button: whether it is pressed.

Parameters

button &Button
The Button instance used by this call (borrow).

Returns

bool — true or false

($&Button) set_read_only

XuAPI
pub fn (button $&Button) set_read_only(read_only bool)

Purpose

Operation on $&Button: set read only.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

(&Button) measure_styled

XuAPI
pub fn (button &Button) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Measure Button with the effective font, density, content and minimum size.

Parameters

button &Button
The Button instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

intrinsic logical size; throws if native shaping fails

(&Button) paint_styled

XuAPI
pub fn (button &Button) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Paint Button using the complete theme; control bounds and Frame use the same local coordinates.

Parameters

button &Button
The Button instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

(&Checkbox) id

XuAPI
pub fn (checkbox &Checkbox) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

int — a value of this type

(&Checkbox) bounds

XuAPI
pub fn (checkbox &Checkbox) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Checkbox) is_focused

XuAPI
pub fn (checkbox &Checkbox) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

(&Checkbox) is_enabled

XuAPI
pub fn (checkbox &Checkbox) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

(&Checkbox) is_invalid

XuAPI
pub fn (checkbox &Checkbox) is_invalid() bool

Purpose

Operation on &Checkbox: whether it is invalid.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

(&Checkbox) is_read_only

XuAPI
pub fn (checkbox &Checkbox) is_read_only() bool

Purpose

Operation on &Checkbox: whether it is read only.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

($&Checkbox) set_read_only

XuAPI
pub fn (checkbox $&Checkbox) set_read_only(read_only bool)

Purpose

Operation on $&Checkbox: set read only.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

This call does not return a value.

(&Checkbox) visual_state

XuAPI
pub fn (checkbox &Checkbox) visual_state() int

Purpose

Operation on &Checkbox: visual state.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

int — a value of this type

(&Checkbox) has_style

XuAPI
pub fn (checkbox &Checkbox) has_style() bool

Purpose

Operation on &Checkbox: whether it has style.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).

Returns

bool — true or false

(&Checkbox) style_or

XuAPI
pub fn (checkbox &Checkbox) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Checkbox: style or.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Checkbox) set_style

XuAPI
pub fn (checkbox $&Checkbox) set_style(style &ControlStyle) int

Purpose

Operation on $&Checkbox: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Checkbox) clear_style

XuAPI
pub fn (checkbox $&Checkbox) clear_style()

Purpose

Operation on $&Checkbox: clear style.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Checkbox) measure_styled

XuAPI
pub fn (checkbox &Checkbox) measure_styled(label $&StyledLabel,styles &Styles) layout.Size

Purpose

Measure Checkbox with the effective font, density, content and minimum size.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

intrinsic logical size; throws if native shaping fails

(&Checkbox) paint_styled

XuAPI
pub fn (checkbox &Checkbox) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Paint Checkbox using the complete theme; control bounds and Frame use the same local coordinates.

Parameters

checkbox &Checkbox
The Checkbox instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

(&Progress) bounds

XuAPI
pub fn (progress &Progress) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Progress) is_enabled

XuAPI
pub fn (progress &Progress) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

(&Progress) is_invalid

XuAPI
pub fn (progress &Progress) is_invalid() bool

Purpose

Operation on &Progress: whether it is invalid.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

(&Progress) is_focused

XuAPI
pub fn (progress &Progress) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

(&Progress) is_selected

XuAPI
pub fn (progress &Progress) is_selected() bool

Purpose

Operation on &Progress: whether it is selected.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

($&Progress) set_focus

XuAPI
pub fn (progress $&Progress) set_focus(focused bool)

Purpose

Operation on $&Progress: set focus.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Progress) set_selected

XuAPI
pub fn (progress $&Progress) set_selected(selected bool)

Purpose

Operation on $&Progress: set selected.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
selected bool
selected (bool)

Returns

This call does not return a value.

(&Progress) visual_state

XuAPI
pub fn (progress &Progress) visual_state() int

Purpose

Operation on &Progress: visual state.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

int — a value of this type

(&Progress) has_style

XuAPI
pub fn (progress &Progress) has_style() bool

Purpose

Operation on &Progress: whether it has style.

Parameters

progress &Progress
The Progress instance used by this call (borrow).

Returns

bool — true or false

(&Progress) style_or

XuAPI
pub fn (progress &Progress) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Progress: style or.

Parameters

progress &Progress
The Progress instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Progress) set_style

XuAPI
pub fn (progress $&Progress) set_style(style &ControlStyle) int

Purpose

Operation on $&Progress: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Progress) clear_style

XuAPI
pub fn (progress $&Progress) clear_style()

Purpose

Operation on $&Progress: clear style.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Progress) measure_styled

XuAPI
pub fn (progress &Progress) measure_styled(styles &Styles) layout.Size

Purpose

Operation on &Progress: measure styled.

Parameters

progress &Progress
The Progress instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(&Progress) paint_styled

XuAPI
pub fn (progress &Progress) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Paint Progress using the complete theme; control bounds and Frame use the same local coordinates.

Parameters

progress &Progress
The Progress instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

($&Button) set_invalid

XuAPI
pub fn (button $&Button) set_invalid(invalid bool)

Purpose

Operation on $&Button: set invalid.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&Button) set_selected

XuAPI
pub fn (button $&Button) set_selected(selected bool)

Purpose

Set a button's persistent selected appearance, for example a toolbar mode toggle.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
selected bool
Whether to display selection; this does not simulate a click or emit activation.

Returns

No return value; changed state marks repainting.

($&Checkbox) set_invalid

XuAPI
pub fn (checkbox $&Checkbox) set_invalid(invalid bool)

Purpose

Operation on $&Checkbox: set invalid.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&Progress) set_enabled

XuAPI
pub fn (progress $&Progress) set_enabled(enabled bool)

Purpose

Operation on $&Progress: set enabled.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Progress) set_invalid

XuAPI
pub fn (progress $&Progress) set_invalid(invalid bool)

Purpose

Operation on $&Progress: set invalid.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&Progress) set_buffer

XuAPI
pub fn (progress $&Progress) set_buffer(value f64) int

Purpose

Operation on $&Progress: set buffer. Throws on failure; handle the error or propagate it to the caller.

Parameters

progress $&Progress
The Progress instance used by this call (exclusive borrow).
value f64
value (f64)

Returns

int — a value of this type

struct Table

XuAPI
pub struct Table {

}

Purpose

A bounded single-line, equal-width column table: 1..16 columns and at most 768 cells (512 rows). Header activation sorts locally unless manual mode is set. Only visible rows are shaped, and their cache slots are reused on scroll.

Public fields

This type has no public fields.

table

XuAPI
pub fn table(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,headers &[]string,rows int,selected int) Table

Purpose

Table. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
headers &[]string
headers (read-only borrow; caller keeps the original; type &[]string)
rows int
rows (int)
selected int
selected (int)

Returns

Table — a value of this type

(&Table) id

XuAPI
pub fn (t &Table) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) bounds

XuAPI
pub fn (t &Table) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Table) count

XuAPI
pub fn (t &Table) count() int

Purpose

Return the number of items in this control.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) column_count

XuAPI
pub fn (t &Table) column_count() int

Purpose

Operation on &Table: column count.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) selected

XuAPI
pub fn (t &Table) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) sort_column

XuAPI
pub fn (t &Table) sort_column() int

Purpose

Operation on &Table: sort column.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) sort_descending

XuAPI
pub fn (t &Table) sort_descending() bool

Purpose

Operation on &Table: sort descending.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

(&Table) scroll_offset

XuAPI
pub fn (t &Table) scroll_offset() f64

Purpose

Operation on &Table: scroll offset.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

f64 — a value of this type

(&Table) needs_paint

XuAPI
pub fn (t &Table) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

($&Table) painted

XuAPI
pub fn (t $&Table) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Table) is_selectable

XuAPI
pub fn (t &Table) is_selectable() bool

Purpose

Operation on &Table: whether it is selectable.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

($&Table) set_selectable

XuAPI
pub fn (t $&Table) set_selectable(selectable bool)

Purpose

Operation on $&Table: set selectable.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&Table) has_popup_open

XuAPI
pub fn (t &Table) has_popup_open() bool

Purpose

Operation on &Table: whether it has popup open.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

(&Table) popup_bounds

XuAPI
pub fn (t &Table) popup_bounds() layout.Rect

Purpose

Operation on &Table: popup bounds.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Table) set_viewport

XuAPI
pub fn (t $&Table) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&Table: set viewport.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&Table) paint_popup_styled

XuAPI
pub fn (t $&Table) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Table: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Table) cursor

XuAPI
pub fn (t &Table) cursor() int

Purpose

Execute cursor on &Table.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) is_enabled

XuAPI
pub fn (t &Table) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

(&Table) is_focused

XuAPI
pub fn (t &Table) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

(&Table) is_read_only

XuAPI
pub fn (t &Table) is_read_only() bool

Purpose

Operation on &Table: whether it is read only.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

bool — true or false

($&Table) cancel

XuAPI
pub fn (t $&Table) cancel()

Purpose

Execute cancel on $&Table.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Table) set_focus

XuAPI
pub fn (t $&Table) set_focus(focused bool)

Purpose

Operation on $&Table: set focus.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&Table) set_enabled

XuAPI
pub fn (t $&Table) set_enabled(enabled bool)

Purpose

Operation on $&Table: set enabled.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&Table) set_read_only

XuAPI
pub fn (t $&Table) set_read_only(value bool) int

Purpose

Operation on $&Table: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

int — a value of this type

($&Table) set_cell

XuAPI
pub fn (t $&Table) set_cell(row int,column int,text &string) int

Purpose

Operation on $&Table: set cell. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
row int
row (int)
column int
column (int)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

(&Table) cell

XuAPI
pub fn (t &Table) cell(row int,column int) string

Purpose

Execute cell on &Table. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Table
The Table instance used by this call (borrow).
row int
row (int)
column int
column (int)

Returns

string — result string

($&Table) set_rows

XuAPI
pub fn (t $&Table) set_rows(count int) int

Purpose

Operation on $&Table: set rows. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
count int
count (int)

Returns

int — a value of this type

($&Table) set_selected

XuAPI
pub fn (t $&Table) set_selected(index int) int

Purpose

Operation on $&Table: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&Table) set_scroll_offset

XuAPI
pub fn (t $&Table) set_scroll_offset(offset f64) int

Purpose

Operation on $&Table: set scroll offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
offset f64
offset (f64)

Returns

int — a value of this type

($&Table) set_bounds

XuAPI
pub fn (t $&Table) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Table: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&Table) style_or

XuAPI
pub fn (t &Table) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Table: style or.

Parameters

t &Table
The Table instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Table) set_style

XuAPI
pub fn (t $&Table) set_style(style &ControlStyle) int

Purpose

Operation on $&Table: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Table) clear_style

XuAPI
pub fn (t $&Table) clear_style()

Purpose

Operation on $&Table: clear style.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Table) apply_styles

XuAPI
pub fn (t $&Table) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Table) row_bounds

XuAPI
pub fn (t &Table) row_bounds(row int) layout.Rect

Purpose

Operation on &Table: row bounds.

Parameters

t &Table
The Table instance used by this call (borrow).
row int
row (int)

Returns

layout.Rect — a value of this type

(&Table) header_bounds

XuAPI
pub fn (t &Table) header_bounds(column int) layout.Rect

Purpose

Operation on &Table: header bounds.

Parameters

t &Table
The Table instance used by this call (borrow).
column int
column (int)

Returns

layout.Rect — a value of this type

(&Table) row_text

XuAPI
pub fn (t &Table) row_text(source_row int) string

Purpose

Operation on &Table: row text.

Parameters

t &Table
The Table instance used by this call (borrow).
source_row int
source_row (int)

Returns

string — result string

($&Table) input

XuAPI
pub fn (t $&Table) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Table) route

XuAPI
pub fn (t $&Table) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Table) event

XuAPI
pub fn (t $&Table) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Table) measure_styled

XuAPI
pub fn (t $&Table) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&Table: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&Table) dispose

XuAPI
pub fn (t $&Table) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Table) selected_text

XuAPI
pub fn (t &Table) selected_text() string

Purpose

Operation on &Table: selected text.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

string — result string

(&Table) column_width

XuAPI
pub fn (t &Table) column_width(column int) f64

Purpose

Operation on &Table: column width. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Table
The Table instance used by this call (borrow).
column int
column (int)

Returns

f64 — a value of this type

($&Table) set_column_width

XuAPI
pub fn (t $&Table) set_column_width(column int,width f64) int

Purpose

Operation on $&Table: set column width. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
column int
column (int)
width f64
width (f64)

Returns

int — a value of this type

($&Table) set_column_alignment

XuAPI
pub fn (t $&Table) set_column_alignment(column int,alignment f64) int

Purpose

Operation on $&Table: set column alignment. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
column int
column (int)
alignment f64
alignment (f64)

Returns

int — a value of this type

($&Table) set_horizontal_offset

XuAPI
pub fn (t $&Table) set_horizontal_offset(offset f64) int

Purpose

Operation on $&Table: set horizontal offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
offset f64
offset (f64)

Returns

int — a value of this type

(&Table) horizontal_offset

XuAPI
pub fn (t &Table) horizontal_offset() f64

Purpose

Operation on &Table: horizontal offset.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

f64 — a value of this type

($&Table) set_status

XuAPI
pub fn (t $&Table) set_status(text &string) int

Purpose

Operation on $&Table: set status. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&Table) paint_styled

XuAPI
pub fn (t $&Table) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Table: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Table) set_column_min_width

XuAPI
pub fn (t $&Table) set_column_min_width(column int,width f64) int

Purpose

Operation on $&Table: set column min width. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
column int
column (int)
width f64
width (f64)

Returns

int — a value of this type

($&Screen) set_table_column_min_width

XuAPI
pub fn (s $&Screen) set_table_column_min_width(id int,column int,width f64) int

Purpose

Operation on $&Screen: set table column min width. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
id int
id (int)
column int
column (int)
width f64
width (f64)

Returns

int — a value of this type

const TABLE_SORT_TEXT

XuAPI
pub const TABLE_SORT_TEXT = 0

Purpose

Constant TABLE_SORT_TEXT, defining protocol or algorithm parameters.

const TABLE_SORT_NUMBER

XuAPI
pub const TABLE_SORT_NUMBER = 1

Purpose

Constant TABLE_SORT_NUMBER, defining protocol or algorithm parameters.

See usage example

(&Table) row_at

XuAPI
pub fn (t &Table) row_at(view_row int) int

Purpose

Source row indices remain stable while the view is sorted. cell/set_cell address source rows; view_cell and row_at address displayed rows. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Table
The Table instance used by this call (borrow).
view_row int
view_row (int)

Returns

int — a value of this type

(&Table) view_row

XuAPI
pub fn (t &Table) view_row(source_row int) int

Purpose

Operation on &Table: view row. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Table
The Table instance used by this call (borrow).
source_row int
source_row (int)

Returns

int — a value of this type

(&Table) selected_row

XuAPI
pub fn (t &Table) selected_row() int

Purpose

Operation on &Table: selected row. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Table
The Table instance used by this call (borrow).

Returns

int — a value of this type

(&Table) view_cell

XuAPI
pub fn (t &Table) view_cell(row int,column int) string

Purpose

Operation on &Table: view cell. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Table
The Table instance used by this call (borrow).
row int
row (int)
column int
column (int)

Returns

string — result string

($&Table) set_selected_row

XuAPI
pub fn (t $&Table) set_selected_row(source_row int) int

Purpose

Operation on $&Table: set selected row. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
source_row int
source_row (int)

Returns

int — a value of this type

($&Table) sort_by

XuAPI
pub fn (t $&Table) sort_by(column int,descending bool) int

Purpose

Operation on $&Table: sort by. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
column int
column (int)
descending bool
descending (bool)

Returns

int — a value of this type

($&Table) refresh_sort

XuAPI
pub fn (t $&Table) refresh_sort() int

Purpose

Operation on $&Table: refresh sort. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&Table) set_sort_kind

XuAPI
pub fn (t $&Table) set_sort_kind(column int,kind int) int

Purpose

Operation on $&Table: set sort kind. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
column int
column (int)
kind int
kind tag (int)

Returns

int — a value of this type

($&Table) set_local_sort

XuAPI
pub fn (t $&Table) set_local_sort(enabled bool) int

Purpose

Manual mode keeps header state/events and lets a remote data source own order. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Table
The Table instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

const TASK_IDLE

XuAPI
pub const TASK_IDLE = 0

Purpose

Constant TASK_IDLE, defining protocol or algorithm parameters.

const TASK_RUNNING

XuAPI
pub const TASK_RUNNING = 1

Purpose

Constant TASK_RUNNING, defining protocol or algorithm parameters.

const TASK_SUCCESS

XuAPI
pub const TASK_SUCCESS = 2

Purpose

Constant TASK_SUCCESS, defining protocol or algorithm parameters.

See usage example

const TASK_ERROR

XuAPI
pub const TASK_ERROR = 3

Purpose

Constant TASK_ERROR, defining protocol or algorithm parameters.

See usage example

const TASK_CANCELLED

XuAPI
pub const TASK_CANCELLED = 4

Purpose

Constant TASK_CANCELLED, defining protocol or algorithm parameters.

See usage example

const TASK_PROGRESS_LINE

XuAPI
pub const TASK_PROGRESS_LINE = 0

Purpose

Constant TASK_PROGRESS_LINE, defining protocol or algorithm parameters.

const TASK_PROGRESS_FILL

XuAPI
pub const TASK_PROGRESS_FILL = 1

Purpose

Constant TASK_PROGRESS_FILL, defining protocol or algorithm parameters.

const TASK_PROGRESS_ICON

XuAPI
pub const TASK_PROGRESS_ICON = 2

Purpose

Constant TASK_PROGRESS_ICON, defining protocol or algorithm parameters.

const ACTION_CANCEL_TASK

XuAPI
pub const ACTION_CANCEL_TASK = 7

Purpose

Constant ACTION_CANCEL_TASK, defining protocol or algorithm parameters.

struct TaskButton

XuAPI
pub struct TaskButton {

}

Purpose

TaskButton context or state structure.

Public fields

This type has no public fields.

task_button

XuAPI
pub fn task_button(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,label &string) TaskButton

Purpose

Task button. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
label &string
label (read-only borrow; caller keeps the original; type &string)

Returns

TaskButton — a value of this type

(&TaskButton) id

XuAPI
pub fn (task &TaskButton) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

int — a value of this type

(&TaskButton) bounds

XuAPI
pub fn (task &TaskButton) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&TaskButton) state

XuAPI
pub fn (task &TaskButton) state() int

Purpose

Execute state on &TaskButton.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

int — a value of this type

(&TaskButton) task_id

XuAPI
pub fn (task &TaskButton) task_id() int

Purpose

Operation on &TaskButton: task id.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

int — a value of this type

(&TaskButton) is_running

XuAPI
pub fn (task &TaskButton) is_running() bool

Purpose

Operation on &TaskButton: whether it is running.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

bool — true or false

(&TaskButton) is_determinate

XuAPI
pub fn (task &TaskButton) is_determinate() bool

Purpose

Operation on &TaskButton: whether it is determinate.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

bool — true or false

(&TaskButton) progress

XuAPI
pub fn (task &TaskButton) progress() f64

Purpose

Execute progress on &TaskButton.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

f64 — a value of this type

(&TaskButton) is_enabled

XuAPI
pub fn (task &TaskButton) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

bool — true or false

(&TaskButton) is_selectable

XuAPI
pub fn (task &TaskButton) is_selectable() bool

Purpose

Operation on &TaskButton: whether it is selectable.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

bool — true or false

($&TaskButton) set_selectable

XuAPI
pub fn (task $&TaskButton) set_selectable(selectable bool)

Purpose

Operation on $&TaskButton: set selectable.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&TaskButton) is_focused

XuAPI
pub fn (task &TaskButton) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

bool — true or false

(&TaskButton) needs_paint

XuAPI
pub fn (task &TaskButton) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).

Returns

bool — true or false

($&TaskButton) painted

XuAPI
pub fn (task $&TaskButton) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TaskButton) cancel

XuAPI
pub fn (task $&TaskButton) cancel()

Purpose

Execute cancel on $&TaskButton.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TaskButton) set_focus

XuAPI
pub fn (task $&TaskButton) set_focus(focused bool)

Purpose

Operation on $&TaskButton: set focus.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&TaskButton) set_enabled

XuAPI
pub fn (task $&TaskButton) set_enabled(enabled bool)

Purpose

Operation on $&TaskButton: set enabled.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&TaskButton) set_bounds

XuAPI
pub fn (task $&TaskButton) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&TaskButton: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&TaskButton) set_style

XuAPI
pub fn (task $&TaskButton) set_style(style &ControlStyle) int

Purpose

Operation on $&TaskButton: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&TaskButton) set_motion

XuAPI
pub fn (task $&TaskButton) set_motion(spec &MotionSpec) int

Purpose

Operation on $&TaskButton: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&TaskButton) set_progress_mode

XuAPI
pub fn (task $&TaskButton) set_progress_mode(mode int) int

Purpose

Operation on $&TaskButton: set progress mode. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
mode int
mode (int)

Returns

int — a value of this type

($&TaskButton) set_labels

XuAPI
pub fn (task $&TaskButton) set_labels(running &string,success &string,error &string,cancelled &string) int

Purpose

Operation on $&TaskButton: set labels. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
running &string
running (read-only borrow; caller keeps the original; type &string)
success &string
success (read-only borrow; caller keeps the original; type &string)
error &string
error (read-only borrow; caller keeps the original; type &string)
cancelled &string
cancelled (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&TaskButton) set_cancellable

XuAPI
pub fn (task $&TaskButton) set_cancellable(enabled bool)

Purpose

Operation on $&TaskButton: set cancellable.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&TaskButton) begin

XuAPI
pub fn (task $&TaskButton) begin(id int,now time.Instant) int

Purpose

Strictly increasing task IDs prevent a late completion from replacing a retry. The caller owns execution, cancellation and all progress reporting. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
id int
id (int)
now time.Instant
now (time.Instant)

Returns

int — a value of this type

($&TaskButton) set_progress

XuAPI
pub fn (task $&TaskButton) set_progress(id int,value f64) bool

Purpose

Operation on $&TaskButton: set progress. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
id int
id (int)
value f64
value (f64)

Returns

bool — true or false

($&TaskButton) complete

XuAPI
pub fn (task $&TaskButton) complete(id int,state int) bool

Purpose

Execute complete on $&TaskButton. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
id int
id (int)
state int
state (int)

Returns

bool — true or false

($&TaskButton) reset

XuAPI
pub fn (task $&TaskButton) reset() int

Purpose

Operation on $&TaskButton: clear internal state so the value can be reused. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TaskButton) input

XuAPI
pub fn (task $&TaskButton) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TaskButton) route

XuAPI
pub fn (task $&TaskButton) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TaskButton) event

XuAPI
pub fn (task $&TaskButton) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TaskButton) tick

XuAPI
pub fn (task $&TaskButton) tick(now time.Instant,reduced bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced bool
reduced (bool)

Returns

bool — true or false

(&TaskButton) next_tick

XuAPI
pub fn (task &TaskButton) next_tick(now time.Instant) time.Instant

Purpose

Operation on &TaskButton: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

task &TaskButton
The TaskButton instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

($&TaskButton) measure_styled

XuAPI
pub fn (task $&TaskButton) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&TaskButton: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&TaskButton) paint_styled

XuAPI
pub fn (task $&TaskButton) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&TaskButton: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&TaskButton) dispose

XuAPI
pub fn (task $&TaskButton) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct TaskFeedback

XuAPI
pub struct TaskFeedback {
    pub delay time.Duration
    pub success_hold time.Duration
    pub percentage bool
    pub thickness f64
}

Purpose

Structure encapsulating delay, success_hold, percentage, thickness.

Public fields

delay time.Duration
field (time.Duration)
success_hold time.Duration
field (time.Duration)
percentage bool
field (bool)
thickness f64
field (f64)

task_feedback

XuAPI
pub fn task_feedback() TaskFeedback

Purpose

Task feedback.

Parameters

No arguments are required.

Returns

TaskFeedback — a value of this type

($&TaskButton) set_feedback

XuAPI
pub fn (task $&TaskButton) set_feedback(feedback &TaskFeedback) int

Purpose

Operation on $&TaskButton: set feedback. Throws on failure; handle the error or propagate it to the caller.

Parameters

task $&TaskButton
The TaskButton instance used by this call (exclusive borrow).
feedback &TaskFeedback
feedback (read-only borrow; caller keeps the original; type &TaskFeedback)

Returns

int — a value of this type

struct TextCache

XuAPI
pub struct TextCache {

}

Purpose

Composite controls share typography while retaining separate native layouts. Cache keys are sparse identities; visible-cell slots can be reused by callers. Native handles are plain values with explicit disposal, like Editor.

Public fields

This type has no public fields.

text_cache

XuAPI
pub fn text_cache(context &draw.Context) TextCache

Purpose

Text cache.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)

Returns

TextCache — a value of this type

($&TextCache) dispose

XuAPI
pub fn (cache $&TextCache) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

cache $&TextCache
The TextCache instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TextCache) measure

XuAPI
pub fn (cache $&TextCache) measure(index int,value &string,styles &Styles,c &ControlStyle) layout.Size

Purpose

Execute measure on $&TextCache. Throws on failure; handle the error or propagate it to the caller.

Parameters

cache $&TextCache
The TextCache instance used by this call (exclusive borrow).
index int
index (int)
value &string
value (read-only borrow; caller keeps the original; type &string)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
c &ControlStyle
byte or character code (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

layout.Size — a value of this type

($&TextCache) paint_text

XuAPI
pub fn (cache $&TextCache) paint_text(index int,value &string,frame $&draw.Frame,bounds &layout.Rect,styles &Styles,c &ControlStyle,state int) int

Purpose

Operation on $&TextCache: paint text. Throws on failure; handle the error or propagate it to the caller.

Parameters

cache $&TextCache
The TextCache instance used by this call (exclusive borrow).
index int
index (int)
value &string
value (read-only borrow; caller keeps the original; type &string)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
c &ControlStyle
byte or character code (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)

Returns

int — a value of this type

const TEXT_MENU_NONE

XuAPI
pub const TEXT_MENU_NONE = 0

Purpose

Constant TEXT_MENU_NONE, defining protocol or algorithm parameters.

const TEXT_MENU_COPY

XuAPI
pub const TEXT_MENU_COPY = 1

Purpose

Constant TEXT_MENU_COPY, defining protocol or algorithm parameters.

const TEXT_MENU_CUT

XuAPI
pub const TEXT_MENU_CUT = 2

Purpose

Constant TEXT_MENU_CUT, defining protocol or algorithm parameters.

const TEXT_MENU_PASTE

XuAPI
pub const TEXT_MENU_PASTE = 3

Purpose

Constant TEXT_MENU_PASTE, defining protocol or algorithm parameters.

const TEXT_MENU_SELECT_ALL

XuAPI
pub const TEXT_MENU_SELECT_ALL = 4

Purpose

Constant TEXT_MENU_SELECT_ALL, defining protocol or algorithm parameters.

const TEXT_MENU_COPY_ROW

XuAPI
pub const TEXT_MENU_COPY_ROW = 5

Purpose

Constant TEXT_MENU_COPY_ROW, defining protocol or algorithm parameters.

const TEXT_KEY_NONE

XuAPI
pub const TEXT_KEY_NONE = 0

Purpose

Constant TEXT_KEY_NONE, defining protocol or algorithm parameters.

const TEXT_KEY_CHANGED

XuAPI
pub const TEXT_KEY_CHANGED = 1

Purpose

Constant TEXT_KEY_CHANGED, defining protocol or algorithm parameters.

const TEXT_KEY_COPY

XuAPI
pub const TEXT_KEY_COPY = 2

Purpose

Constant TEXT_KEY_COPY, defining protocol or algorithm parameters.

struct TextRange

XuAPI
pub struct TextRange {
    pub start int
    pub end int
}

Purpose

Structure encapsulating start, end.

Public fields

start int
field (int)
end int
field (int)

text_range

XuAPI
pub fn text_range(a int,b int) TextRange

Purpose

Text range.

Parameters

a int
value (int)
b int
b (int)

Returns

TextRange — a value of this type

(&TextRange) empty

XuAPI
pub fn (range &TextRange) empty() bool

Purpose

Report whether the geometry rectangle is empty (dx <= 0 or dy <= 0).

Parameters

range &TextRange
The TextRange instance used by this call (borrow).

Returns

bool — true or false

(&TextRange) length

XuAPI
pub fn (range &TextRange) length() int

Purpose

Operation on &TextRange: return the current length.

Parameters

range &TextRange
The TextRange instance used by this call (borrow).

Returns

int — a value of this type

selection_prev_boundary

XuAPI
pub fn selection_prev_boundary(value &string,index int) int

Purpose

Selection prev boundary.

Parameters

value &string
value (read-only borrow; caller keeps the original; type &string)
index int
index (int)

Returns

int — a value of this type

selection_next_boundary

XuAPI
pub fn selection_next_boundary(value &string,index int) int

Purpose

Selection next boundary.

Parameters

value &string
value (read-only borrow; caller keeps the original; type &string)
index int
index (int)

Returns

int — a value of this type

word_range_at

XuAPI
pub fn word_range_at(value &string,index int) TextRange

Purpose

Word range at.

Parameters

value &string
value (read-only borrow; caller keeps the original; type &string)
index int
index (int)

Returns

TextRange — a value of this type

line_range_at

XuAPI
pub fn line_range_at(value &string,index int) TextRange

Purpose

Line range at.

Parameters

value &string
value (read-only borrow; caller keeps the original; type &string)
index int
index (int)

Returns

TextRange — a value of this type

struct TextMenuSpec

XuAPI
pub struct TextMenuSpec {
    pub show_cut bool
    pub cut_enabled bool
    pub show_copy bool
    pub copy_enabled bool
    pub show_paste bool
    pub paste_enabled bool
    pub show_select_all bool
    pub select_all_enabled bool
    pub show_copy_row bool
    pub copy_row_enabled bool
}

Purpose

Structure encapsulating show_cut, cut_enabled, show_copy, copy_enabled, show_paste.

Public fields

show_cut bool
field (bool)
cut_enabled bool
field (bool)
show_copy bool
field (bool)
copy_enabled bool
field (bool)
show_paste bool
field (bool)
paste_enabled bool
field (bool)
show_select_all bool
field (bool)
select_all_enabled bool
field (bool)
show_copy_row bool
field (bool)
copy_row_enabled bool
field (bool)

text_menu_spec_readonly

XuAPI
pub fn text_menu_spec_readonly(has_selection bool,has_text bool) TextMenuSpec

Purpose

Text menu spec readonly.

Parameters

has_selection bool
has_selection (bool)
has_text bool
has_text (bool)

Returns

TextMenuSpec — a value of this type

text_menu_spec_editable

XuAPI
pub fn text_menu_spec_editable(has_selection bool,has_text bool,can_paste bool) TextMenuSpec

Purpose

Text menu spec editable.

Parameters

has_selection bool
has_selection (bool)
has_text bool
has_text (bool)
can_paste bool
can_paste (bool)

Returns

TextMenuSpec — a value of this type

struct TextContextMenuItem

XuAPI
pub struct TextContextMenuItem {
    pub cmd int
    pub enabled bool
}

Purpose

Structure encapsulating cmd, enabled.

Public fields

cmd int
field (int)
enabled bool
field (bool)

struct TextMenuResult

XuAPI
pub struct TextMenuResult {
    pub consumed bool
    pub closed bool
    pub cmd int
    pub dirty bool
}

Purpose

Structure encapsulating consumed, closed, cmd, dirty.

Public fields

consumed bool
field (bool)
closed bool
field (bool)
cmd int
field (int)
dirty bool
field (bool)

try_copy_clipboard

XuAPI
pub fn try_copy_clipboard(identity &ui.CanvasEvent,text &string) int

Purpose

Try copy clipboard.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

paint_text_selection

XuAPI
pub fn paint_text_selection(frame $&draw.Frame,shaped &draw.TextLayout,origin_x f64,origin_y f64,anchor int,focus int,bg draw.Color,fg draw.Color,text_len int) int

Purpose

Paint text selection. Throws on failure; handle the error or propagate it to the caller.

Parameters

frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
shaped &draw.TextLayout
shaped (read-only borrow; caller keeps the original; type &draw.TextLayout)
origin_x f64
origin_x (f64)
origin_y f64
origin_y (f64)
anchor int
anchor (int)
focus int
focus (int)
bg draw.Color
bg (draw.Color)
fg draw.Color
fg (draw.Color)
text_len int
text_len (int)

Returns

int — a value of this type

($&TextCache) ensure_layout_for

XuAPI
pub fn (cache $&TextCache) ensure_layout_for(index int,value &string,bounds &layout.Rect,styles &Styles,c &ControlStyle,wrapped bool) draw.TextLayout

Purpose

Operation on $&TextCache: ensure layout for. Throws on failure; handle the error or propagate it to the caller.

Parameters

cache $&TextCache
The TextCache instance used by this call (exclusive borrow).
index int
index (int)
value &string
value (read-only borrow; caller keeps the original; type &string)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
c &ControlStyle
byte or character code (read-only borrow; caller keeps the original; type &ControlStyle)
wrapped bool
wrapped (bool)

Returns

draw.TextLayout — a value of this type

($&TextCache) hit_test_at

XuAPI
pub fn (cache $&TextCache) hit_test_at(index int,value &string,bounds &layout.Rect,styles &Styles,c &ControlStyle,wrapped bool,x f64,y f64) int

Purpose

Operation on $&TextCache: hit test at. Throws on failure; handle the error or propagate it to the caller.

Parameters

cache $&TextCache
The TextCache instance used by this call (exclusive borrow).
index int
index (int)
value &string
value (read-only borrow; caller keeps the original; type &string)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
c &ControlStyle
byte or character code (read-only borrow; caller keeps the original; type &ControlStyle)
wrapped bool
wrapped (bool)
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&TextCache) paint_text_selected

XuAPI
pub fn (cache $&TextCache) paint_text_selected(index int,value &string,frame $&draw.Frame,bounds &layout.Rect,styles &Styles,c &ControlStyle,state int,sel_anchor int,sel_focus int,wrapped bool) int

Purpose

Operation on $&TextCache: paint text selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

cache $&TextCache
The TextCache instance used by this call (exclusive borrow).
index int
index (int)
value &string
value (read-only borrow; caller keeps the original; type &string)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
c &ControlStyle
byte or character code (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)
sel_anchor int
sel_anchor (int)
sel_focus int
sel_focus (int)
wrapped bool
wrapped (bool)

Returns

int — a value of this type

styled_label_ensure

XuAPI
pub fn styled_label_ensure(label $&StyledLabel,bounds &layout.Rect,styles &Styles,fallback &ControlStyle,wrapped bool) layout.Size

Purpose

Styled label ensure. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)
wrapped bool
wrapped (bool)

Returns

layout.Size — a value of this type

styled_label_hit_test

XuAPI
pub fn styled_label_hit_test(label $&StyledLabel,bounds &layout.Rect,styles &Styles,fallback &ControlStyle,wrapped bool,x f64,y f64) int

Purpose

Styled label hit test. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)
wrapped bool
wrapped (bool)
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

paint_styled_label_selected

XuAPI
pub fn paint_styled_label_selected(label $&StyledLabel,frame $&draw.Frame,bounds &layout.Rect,styles &Styles,fallback &ControlStyle,state int,sel_anchor int,sel_focus int,wrapped bool,ellipsis bool) int

Purpose

Paint styled label selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
fallback &ControlStyle
fallback (read-only borrow; caller keeps the original; type &ControlStyle)
state int
state (int)
sel_anchor int
sel_anchor (int)
sel_focus int
sel_focus (int)
wrapped bool
wrapped (bool)
ellipsis bool
ellipsis (bool)

Returns

int — a value of this type

paint_styled_label_at_origin

XuAPI
pub fn paint_styled_label_at_origin(label &StyledLabel,frame $&draw.Frame,tx f64,ty f64,resolved &ResolvedStyle,sel_anchor int,sel_focus int) int

Purpose

Paint styled label at origin. Throws on failure; handle the error or propagate it to the caller.

Parameters

label &StyledLabel
label (read-only borrow; caller keeps the original; type &StyledLabel)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
tx f64
tx (f64)
ty f64
ty (f64)
resolved &ResolvedStyle
resolved (read-only borrow; caller keeps the original; type &ResolvedStyle)
sel_anchor int
sel_anchor (int)
sel_focus int
sel_focus (int)

Returns

int — a value of this type

hit_test_styled_label_at_origin

XuAPI
pub fn hit_test_styled_label_at_origin(label &StyledLabel,tx f64,ty f64,x f64,y f64) int

Purpose

Hit test styled label at origin.

Parameters

label &StyledLabel
label (read-only borrow; caller keeps the original; type &StyledLabel)
tx f64
tx (f64)
ty f64
ty (f64)
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

struct TextSelectionEngine

XuAPI
pub struct TextSelectionEngine {
    pub selectable bool
    pub anchor int
    pub focus int
    pub selecting bool
}

Purpose

Structure encapsulating selectable, anchor, focus, selecting.

Public fields

selectable bool
field (bool)
anchor int
field (int)
focus int
field (int)
selecting bool
field (bool)

text_selection_engine

XuAPI
pub fn text_selection_engine(selectable bool) TextSelectionEngine

Purpose

Text selection engine.

Parameters

selectable bool
selectable (bool)

Returns

TextSelectionEngine — a value of this type

(&TextSelectionEngine) has_selection

XuAPI
pub fn (e &TextSelectionEngine) has_selection() bool

Purpose

Operation on &TextSelectionEngine: whether it has selection.

Parameters

e &TextSelectionEngine
The TextSelectionEngine instance used by this call (borrow).

Returns

bool — true or false

(&TextSelectionEngine) is_drag_char

XuAPI
pub fn (e &TextSelectionEngine) is_drag_char() bool

Purpose

Operation on &TextSelectionEngine: whether it is drag char.

Parameters

e &TextSelectionEngine
The TextSelectionEngine instance used by this call (borrow).

Returns

bool — true or false

($&TextSelectionEngine) reset_clicks

XuAPI
pub fn (e $&TextSelectionEngine) reset_clicks()

Purpose

Operation on $&TextSelectionEngine: reset clicks.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&TextSelectionEngine) range

XuAPI
pub fn (e &TextSelectionEngine) range(text_len int) ui.TextRange

Purpose

Execute range on &TextSelectionEngine.

Parameters

e &TextSelectionEngine
The TextSelectionEngine instance used by this call (borrow).
text_len int
text_len (int)

Returns

ui.TextRange — a value of this type

(&TextSelectionEngine) selected_text

XuAPI
pub fn (e &TextSelectionEngine) selected_text(text &string) string

Purpose

Operation on &TextSelectionEngine: selected text.

Parameters

e &TextSelectionEngine
The TextSelectionEngine instance used by this call (borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

string — result string

($&TextSelectionEngine) clear

XuAPI
pub fn (e $&TextSelectionEngine) clear() bool

Purpose

Clear all buffered or stored entries and internal state.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).

Returns

bool — true or false

($&TextSelectionEngine) set_selectable

XuAPI
pub fn (e $&TextSelectionEngine) set_selectable(selectable bool) bool

Purpose

Operation on $&TextSelectionEngine: set selectable.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

bool — true or false

($&TextSelectionEngine) select_all

XuAPI
pub fn (e $&TextSelectionEngine) select_all(text &string) bool

Purpose

Operation on $&TextSelectionEngine: select all.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

bool — true or false

($&TextSelectionEngine) set_range

XuAPI
pub fn (e $&TextSelectionEngine) set_range(text &string,start int,end int) bool

Purpose

Operation on $&TextSelectionEngine: set range.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
start int
start (int)
end int
end (int)

Returns

bool — true or false

($&TextSelectionEngine) begin_pointer_down

XuAPI
pub fn (e $&TextSelectionEngine) begin_pointer_down(text &string,idx int,event &ui.InputEvent) bool

Purpose

Operation on $&TextSelectionEngine: begin pointer down.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
idx int
idx (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

bool — true or false

($&TextSelectionEngine) drag_pointer

XuAPI
pub fn (e $&TextSelectionEngine) drag_pointer(text &string,idx int) bool

Purpose

Operation on $&TextSelectionEngine: drag pointer.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
idx int
idx (int)

Returns

bool — true or false

($&TextSelectionEngine) end_pointer

XuAPI
pub fn (e $&TextSelectionEngine) end_pointer() bool

Purpose

Operation on $&TextSelectionEngine: end pointer.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).

Returns

bool — true or false

($&TextSelectionEngine) key_navigation

XuAPI
pub fn (e $&TextSelectionEngine) key_navigation(text &string,event &ui.InputEvent) int

Purpose

Operation on $&TextSelectionEngine: key navigation.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

int — a value of this type

($&TextSelectionEngine) key_navigation_layout

XuAPI
pub fn (e $&TextSelectionEngine) key_navigation_layout(text &string,shaped &draw.TextLayout,event &ui.InputEvent) int

Purpose

Operation on $&TextSelectionEngine: key navigation layout.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
shaped &draw.TextLayout
shaped (read-only borrow; caller keeps the original; type &draw.TextLayout)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

int — a value of this type

font_vertical_step_focus

XuAPI
pub fn font_vertical_step_focus(shaped &font.TextLayout,text &string,cur_focus int,key int) int

Purpose

Font vertical step focus.

Parameters

shaped &font.TextLayout
shaped (read-only borrow; caller keeps the original; type &font.TextLayout)
text &string
text (read-only borrow; caller keeps the original; type &string)
cur_focus int
cur_focus (int)
key int
key (int)

Returns

int — a value of this type

($&TextSelectionEngine) key_navigation_font_layout

XuAPI
pub fn (e $&TextSelectionEngine) key_navigation_font_layout(text &string,shaped &font.TextLayout,event &ui.InputEvent) int

Purpose

Operation on $&TextSelectionEngine: key navigation font layout.

Parameters

e $&TextSelectionEngine
The TextSelectionEngine instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
shaped &font.TextLayout
shaped (read-only borrow; caller keeps the original; type &font.TextLayout)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

int — a value of this type

text_menu_item_label

XuAPI
pub fn text_menu_item_label(locale &Locale,cmd int) string

Purpose

Text menu item label.

Parameters

locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)
cmd int
cmd (int)

Returns

string — result string

text_menu_shortcut_label

XuAPI
pub fn text_menu_shortcut_label(cmd int) string

Purpose

Text menu shortcut label.

Parameters

cmd int
cmd (int)

Returns

string — result string

is_context_trigger

XuAPI
pub fn is_context_trigger(event &ui.InputEvent) bool

Purpose

Whether it is context trigger.

Parameters

event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

bool — true or false

struct TextContextMenu

XuAPI
pub struct TextContextMenu {

}

Purpose

TextContextMenu context or state structure.

Public fields

This type has no public fields.

text_context_menu

XuAPI
pub fn text_context_menu(context &draw.Context,identity &ui.CanvasEvent,id int) TextContextMenu

Purpose

Text context menu.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)

Returns

TextContextMenu — a value of this type

(&TextContextMenu) is_open

XuAPI
pub fn (m &TextContextMenu) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

m &TextContextMenu
The TextContextMenu instance used by this call (borrow).

Returns

bool — true or false

(&TextContextMenu) needs_paint

XuAPI
pub fn (m &TextContextMenu) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

m &TextContextMenu
The TextContextMenu instance used by this call (borrow).

Returns

bool — true or false

($&TextContextMenu) painted

XuAPI
pub fn (m $&TextContextMenu) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&TextContextMenu) popup_bounds

XuAPI
pub fn (m &TextContextMenu) popup_bounds() layout.Rect

Purpose

Operation on &TextContextMenu: popup bounds.

Parameters

m &TextContextMenu
The TextContextMenu instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&TextContextMenu) dispose

XuAPI
pub fn (m $&TextContextMenu) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&TextContextMenu) clone_menu

XuAPI
pub fn (m &TextContextMenu) clone_menu() TextContextMenu

Purpose

Operation on &TextContextMenu: clone menu.

Parameters

m &TextContextMenu
The TextContextMenu instance used by this call (borrow).

Returns

TextContextMenu — a value of this type

($&TextContextMenu) set_locale

XuAPI
pub fn (m $&TextContextMenu) set_locale(locale &Locale) int

Purpose

Operation on $&TextContextMenu: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&TextContextMenu) set_zh

XuAPI
pub fn (m $&TextContextMenu) set_zh(zh bool)

Purpose

Operation on $&TextContextMenu: set zh.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).
zh bool
zh (bool)

Returns

This call does not return a value.

($&TextContextMenu) set_viewport

XuAPI
pub fn (m $&TextContextMenu) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&TextContextMenu: set viewport.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&TextContextMenu) open

XuAPI
pub fn (m $&TextContextMenu) open(x f64,y f64,spec &TextMenuSpec,density f64) bool

Purpose

Operation on $&TextContextMenu: open resource or establish connection.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
spec &TextMenuSpec
spec (read-only borrow; caller keeps the original; type &TextMenuSpec)
density f64
density (f64)

Returns

bool — true or false

($&TextContextMenu) close

XuAPI
pub fn (m $&TextContextMenu) close() bool

Purpose

Operation on $&TextContextMenu: close the resource.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).

Returns

bool — true or false

($&TextContextMenu) input

XuAPI
pub fn (m $&TextContextMenu) input(event &ui.InputEvent,density f64) TextMenuResult

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)
density f64
density (f64)

Returns

TextMenuResult — a value of this type

($&TextContextMenu) paint_styled

XuAPI
pub fn (m $&TextContextMenu) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&TextContextMenu: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

m $&TextContextMenu
The TextContextMenu instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

paint_text_context_menu_err

XuAPI
pub fn paint_text_context_menu_err(m $&TextContextMenu,frame $&draw.Frame,styles &Styles) string

Purpose

Paint text context menu err.

Parameters

m $&TextContextMenu
m (exclusive borrow; may modify the original; type $&TextContextMenu)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

string — result string

struct ListTextAux

XuAPI
pub struct ListTextAux {
    pub drag_start_x f64
    pub drag_start_y f64
    pub drag_moved bool
    pub sel_row int
    pub sel_col int
    pub active_text string
    pub row_text string
    pub viewport layout.Rect
    pub zh bool
    pub selection TextSelectionEngine
    pub menus map[int]TextContextMenu
    pub cached_styles []Styles
}

Purpose

Structure encapsulating drag_start_x, drag_start_y, drag_moved, sel_row, sel_col.

Public fields

drag_start_x f64
field (f64)
drag_start_y f64
field (f64)
drag_moved bool
field (bool)
sel_row int
field (int)
sel_col int
field (int)
active_text string
field (string)
row_text string
field (string)
viewport layout.Rect
field (layout.Rect)
zh bool
field (bool)
selection TextSelectionEngine
field (TextSelectionEngine)
menus map[int]TextContextMenu
field (map[int]TextContextMenu)
cached_styles []Styles
field ([]Styles)

list_text_aux_new

XuAPI
pub fn list_text_aux_new(selectable bool) ListTextAux

Purpose

List text aux new.

Parameters

selectable bool
selectable (bool)

Returns

ListTextAux — a value of this type

(&ListTextAux) has_menu

XuAPI
pub fn (aux &ListTextAux) has_menu() bool

Purpose

Operation on &ListTextAux: whether it has menu.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

bool — true or false

(&ListTextAux) is_menu_open

XuAPI
pub fn (aux &ListTextAux) is_menu_open() bool

Purpose

Operation on &ListTextAux: whether it is menu open.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

bool — true or false

(&ListTextAux) menu_bounds

XuAPI
pub fn (aux &ListTextAux) menu_bounds() layout.Rect

Purpose

Operation on &ListTextAux: menu bounds.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&ListTextAux) menu_needs_paint

XuAPI
pub fn (aux &ListTextAux) menu_needs_paint() bool

Purpose

Operation on &ListTextAux: menu needs paint.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

bool — true or false

(&ListTextAux) has_selection_for

XuAPI
pub fn (aux &ListTextAux) has_selection_for(row int,col int) bool

Purpose

Operation on &ListTextAux: whether it has selection for.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).
row int
row (int)
col int
col (int)

Returns

bool — true or false

(&ListTextAux) sel_anchor

XuAPI
pub fn (aux &ListTextAux) sel_anchor() int

Purpose

Operation on &ListTextAux: sel anchor.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

int — a value of this type

(&ListTextAux) sel_focus

XuAPI
pub fn (aux &ListTextAux) sel_focus() int

Purpose

Operation on &ListTextAux: sel focus.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

int — a value of this type

(&ListTextAux) get_sel_row

XuAPI
pub fn (aux &ListTextAux) get_sel_row() int

Purpose

Operation on &ListTextAux: read sel row.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

int — a value of this type

(&ListTextAux) get_sel_col

XuAPI
pub fn (aux &ListTextAux) get_sel_col() int

Purpose

Operation on &ListTextAux: read sel col.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

int — a value of this type

(&ListTextAux) has_active_text

XuAPI
pub fn (aux &ListTextAux) has_active_text() bool

Purpose

Operation on &ListTextAux: whether it has active text.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

bool — true or false

(&ListTextAux) get_active_text

XuAPI
pub fn (aux &ListTextAux) get_active_text() string

Purpose

Operation on &ListTextAux: read active text.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

string — result string

(&ListTextAux) get_row_text

XuAPI
pub fn (aux &ListTextAux) get_row_text() string

Purpose

Operation on &ListTextAux: read row text.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

string — result string

(&ListTextAux) selected_text

XuAPI
pub fn (aux &ListTextAux) selected_text() string

Purpose

Operation on &ListTextAux: selected text.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

string — result string

(&ListTextAux) style_snapshot

XuAPI
pub fn (aux &ListTextAux) style_snapshot() Styles

Purpose

Operation on &ListTextAux: style snapshot.

Parameters

aux &ListTextAux
The ListTextAux instance used by this call (borrow).

Returns

Styles — a value of this type

($&ListTextAux) set_styles_cache

XuAPI
pub fn (aux $&ListTextAux) set_styles_cache(styles &Styles)

Purpose

Operation on $&ListTextAux: set styles cache.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

This call does not return a value.

($&ListTextAux) ensure_menu

XuAPI
pub fn (aux $&ListTextAux) ensure_menu(context &draw.Context,identity &ui.CanvasEvent,id int)

Purpose

Operation on $&ListTextAux: ensure menu.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)

Returns

This call does not return a value.

($&ListTextAux) set_zh

XuAPI
pub fn (aux $&ListTextAux) set_zh(zh bool)

Purpose

Operation on $&ListTextAux: set zh.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
zh bool
zh (bool)

Returns

This call does not return a value.

($&ListTextAux) set_viewport

XuAPI
pub fn (aux $&ListTextAux) set_viewport(viewport &layout.Rect,context &draw.Context,identity &ui.CanvasEvent,id int)

Purpose

Operation on $&ListTextAux: set viewport.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)

Returns

This call does not return a value.

($&ListTextAux) painted

XuAPI
pub fn (aux $&ListTextAux) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&ListTextAux) close_menu

XuAPI
pub fn (aux $&ListTextAux) close_menu() bool

Purpose

Operation on $&ListTextAux: close menu.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).

Returns

bool — true or false

($&ListTextAux) paint_menu_styled

XuAPI
pub fn (aux $&ListTextAux) paint_menu_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&ListTextAux: paint menu styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&ListTextAux) route_menu

XuAPI
pub fn (aux $&ListTextAux) route_menu(event &ui.InputEvent,density f64) TextMenuResult

Purpose

Operation on $&ListTextAux: route menu.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)
density f64
density (f64)

Returns

TextMenuResult — a value of this type

($&ListTextAux) open_menu

XuAPI
pub fn (aux $&ListTextAux) open_menu(context &draw.Context,identity &ui.CanvasEvent,id int,x f64,y f64,show_row bool,density f64) bool

Purpose

Operation on $&ListTextAux: open menu.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
x f64
value (f64)
y f64
value (f64)
show_row bool
show_row (bool)
density f64
density (f64)

Returns

bool — true or false

($&ListTextAux) open_cached_menu

XuAPI
pub fn (aux $&ListTextAux) open_cached_menu(x f64,y f64,show_row bool,density f64) bool

Purpose

Operation on $&ListTextAux: open cached menu.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
show_row bool
show_row (bool)
density f64
density (f64)

Returns

bool — true or false

($&ListTextAux) handle_menu_cmd

XuAPI
pub fn (aux $&ListTextAux) handle_menu_cmd(cmd int,identity &ui.CanvasEvent) bool

Purpose

Operation on $&ListTextAux: handle menu cmd.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
cmd int
cmd (int)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)

Returns

bool — true or false

($&ListTextAux) begin_pointer

XuAPI
pub fn (aux $&ListTextAux) begin_pointer(text &string,row_text &string,idx int,row int,col int,event &ui.InputEvent) bool

Purpose

Operation on $&ListTextAux: begin pointer.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
text &string
text (read-only borrow; caller keeps the original; type &string)
row_text &string
row_text (read-only borrow; caller keeps the original; type &string)
idx int
idx (int)
row int
row (int)
col int
col (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

bool — true or false

($&ListTextAux) should_begin_drag

XuAPI
pub fn (aux $&ListTextAux) should_begin_drag(x f64,y f64,density f64) bool

Purpose

Operation on $&ListTextAux: should begin drag.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
x f64
value (f64)
y f64
value (f64)
density f64
density (f64)

Returns

bool — true or false

($&ListTextAux) drag_to

XuAPI
pub fn (aux $&ListTextAux) drag_to(idx int) bool

Purpose

Operation on $&ListTextAux: drag to.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
idx int
idx (int)

Returns

bool — true or false

($&ListTextAux) end_pointer

XuAPI
pub fn (aux $&ListTextAux) end_pointer() bool

Purpose

Operation on $&ListTextAux: end pointer.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).

Returns

bool — true or false

($&ListTextAux) clear_selection

XuAPI
pub fn (aux $&ListTextAux) clear_selection() bool

Purpose

Operation on $&ListTextAux: clear selection.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).

Returns

bool — true or false

($&ListTextAux) key_action

XuAPI
pub fn (aux $&ListTextAux) key_action(event &ui.InputEvent,identity &ui.CanvasEvent) int

Purpose

Operation on $&ListTextAux: key action.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)

Returns

int — a value of this type

($&ListTextAux) dispose

XuAPI
pub fn (aux $&ListTextAux) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

aux $&ListTextAux
The ListTextAux instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct TimePicker

XuAPI
pub struct TimePicker {

}

Purpose

A 24-hour segmented field. Editing changes the selected clock component, wraps within that component, and preserves the date and subsecond value.

Public fields

This type has no public fields.

time_picker

XuAPI
pub fn time_picker(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect,value time.Time) TimePicker

Purpose

Time picker. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
value time.Time
value (time.Time)

Returns

TimePicker — a value of this type

(&TimePicker) id

XuAPI
pub fn (picker &TimePicker) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

int — a value of this type

(&TimePicker) bounds

XuAPI
pub fn (picker &TimePicker) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&TimePicker) value

XuAPI
pub fn (picker &TimePicker) value() time.Time

Purpose

Execute value on &TimePicker.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

time.Time — a value of this type

(&TimePicker) selected_part

XuAPI
pub fn (picker &TimePicker) selected_part() int

Purpose

Operation on &TimePicker: selected part.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

int — a value of this type

(&TimePicker) is_selectable

XuAPI
pub fn (picker &TimePicker) is_selectable() bool

Purpose

Operation on &TimePicker: whether it is selectable.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

bool — true or false

($&TimePicker) set_selectable

XuAPI
pub fn (picker $&TimePicker) set_selectable(selectable bool)

Purpose

Operation on $&TimePicker: set selectable.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&TimePicker) needs_paint

XuAPI
pub fn (picker &TimePicker) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

bool — true or false

(&TimePicker) visual_state

XuAPI
pub fn (picker &TimePicker) visual_state() int

Purpose

Operation on &TimePicker: visual state.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

int — a value of this type

(&TimePicker) style_or

XuAPI
pub fn (picker &TimePicker) style_or(styles &Styles) ControlStyle

Purpose

Operation on &TimePicker: style or.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&TimePicker) set_style

XuAPI
pub fn (picker $&TimePicker) set_style(style &ControlStyle) int

Purpose

Operation on $&TimePicker: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&TimePicker) set_value

XuAPI
pub fn (picker $&TimePicker) set_value(value time.Time) int

Purpose

Operation on $&TimePicker: set value. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
value time.Time
value (time.Time)

Returns

int — a value of this type

($&TimePicker) set_show_seconds

XuAPI
pub fn (picker $&TimePicker) set_show_seconds(show bool)

Purpose

Operation on $&TimePicker: set show seconds.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
show bool
show (bool)

Returns

This call does not return a value.

($&TimePicker) set_enabled

XuAPI
pub fn (picker $&TimePicker) set_enabled(enabled bool)

Purpose

Operation on $&TimePicker: set enabled.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&TimePicker) set_read_only

XuAPI
pub fn (picker $&TimePicker) set_read_only(read_only bool) int

Purpose

Operation on $&TimePicker: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
read_only bool
read_only (bool)

Returns

int — a value of this type

($&TimePicker) set_invalid

XuAPI
pub fn (picker $&TimePicker) set_invalid(invalid bool)

Purpose

Operation on $&TimePicker: set invalid.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
invalid bool
invalid (bool)

Returns

This call does not return a value.

($&TimePicker) set_focus

XuAPI
pub fn (picker $&TimePicker) set_focus(focused bool)

Purpose

Operation on $&TimePicker: set focus.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&TimePicker) set_bounds

XuAPI
pub fn (picker $&TimePicker) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&TimePicker: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

(&TimePicker) part_bounds

XuAPI
pub fn (picker &TimePicker) part_bounds(part int) layout.Rect

Purpose

Operation on &TimePicker: part bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).
part int
part (int)

Returns

layout.Rect — a value of this type

($&TimePicker) input

XuAPI
pub fn (picker $&TimePicker) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TimePicker) route

XuAPI
pub fn (picker $&TimePicker) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TimePicker) measure_styled

XuAPI
pub fn (picker $&TimePicker) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&TimePicker: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&TimePicker) paint_styled

XuAPI
pub fn (picker $&TimePicker) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&TimePicker: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&TimePicker) dispose

XuAPI
pub fn (picker $&TimePicker) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TimePicker) set_12_hour

XuAPI
pub fn (picker $&TimePicker) set_12_hour(enabled bool)

Purpose

Operation on $&TimePicker: set 12 hour.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

(&TimePicker) period_bounds

XuAPI
pub fn (picker &TimePicker) period_bounds() layout.Rect

Purpose

Operation on &TimePicker: period bounds.

Parameters

picker &TimePicker
The TimePicker instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&TimePicker) apply_styles

XuAPI
pub fn (picker $&TimePicker) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

picker $&TimePicker
The TimePicker instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct Toast

XuAPI
pub struct Toast {

}

Purpose

One toast, with host-owned text and stacking. Lifetime zero is persistent. Hover/focus pauses expiry. tick/next_tick are explicit; idle toasts do no work.

Public fields

This type has no public fields.

toast

XuAPI
pub fn toast(identity &ui.CanvasEvent,id int,bounds &layout.Rect) Toast

Purpose

Execute toast. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Toast — a value of this type

(&Toast) id

XuAPI
pub fn (t &Toast) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

int — a value of this type

(&Toast) bounds

XuAPI
pub fn (t &Toast) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Toast) is_enabled

XuAPI
pub fn (t &Toast) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

bool — true or false

(&Toast) is_selectable

XuAPI
pub fn (t &Toast) is_selectable() bool

Purpose

Operation on &Toast: whether it is selectable.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

bool — true or false

($&Toast) set_selectable

XuAPI
pub fn (t $&Toast) set_selectable(selectable bool)

Purpose

Operation on $&Toast: set selectable.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Toast) set_action_width

XuAPI
pub fn (t $&Toast) set_action_width(width f64)

Purpose

Operation on $&Toast: set action width.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
width f64
width (f64)

Returns

This call does not return a value.

(&Toast) text_bounds

XuAPI
pub fn (t &Toast) text_bounds() layout.Rect

Purpose

Operation on &Toast: text bounds.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Toast) set_text

XuAPI
pub fn (t $&Toast) set_text(context &draw.Context,text &string) int

Purpose

Operation on $&Toast: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&Toast) set_viewport

XuAPI
pub fn (t $&Toast) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&Toast: set viewport.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&Toast) set_locale

XuAPI
pub fn (t $&Toast) set_locale(locale &Locale) int

Purpose

Operation on $&Toast: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

(&Toast) has_popup_open

XuAPI
pub fn (t &Toast) has_popup_open() bool

Purpose

Operation on &Toast: whether it has popup open.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

bool — true or false

(&Toast) popup_bounds

XuAPI
pub fn (t &Toast) popup_bounds() layout.Rect

Purpose

Operation on &Toast: popup bounds.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Toast) selected_text

XuAPI
pub fn (t &Toast) selected_text() string

Purpose

Operation on &Toast: selected text.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

string — result string

(&Toast) copy_selection

XuAPI
pub fn (t &Toast) copy_selection() int

Purpose

Operation on &Toast: copy selection.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

int — a value of this type

(&Toast) cursor

XuAPI
pub fn (t &Toast) cursor() int

Purpose

Execute cursor on &Toast.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

int — a value of this type

(&Toast) is_open

XuAPI
pub fn (t &Toast) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

bool — true or false

(&Toast) is_visible

XuAPI
pub fn (t &Toast) is_visible() bool

Purpose

Operation on &Toast: whether it is visible.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

bool — true or false

(&Toast) opacity

XuAPI
pub fn (t &Toast) opacity() f64

Purpose

Execute opacity on &Toast.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

f64 — a value of this type

(&Toast) needs_paint

XuAPI
pub fn (t &Toast) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

bool — true or false

($&Toast) painted

XuAPI
pub fn (t $&Toast) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&Toast) close_bounds

XuAPI
pub fn (t &Toast) close_bounds() layout.Rect

Purpose

Operation on &Toast: close bounds.

Parameters

t &Toast
The Toast instance used by this call (borrow).

Returns

layout.Rect — a value of this type

($&Toast) set_bounds

XuAPI
pub fn (t $&Toast) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&Toast: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Toast) show

XuAPI
pub fn (t $&Toast) show(now time.Instant,lifetime time.Duration,reduced_motion bool) int

Purpose

Execute show on $&Toast. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
lifetime time.Duration
lifetime (time.Duration)
reduced_motion bool
reduced_motion (bool)

Returns

int — a value of this type

($&Toast) dismiss

XuAPI
pub fn (t $&Toast) dismiss(now time.Instant,reduced_motion bool) int

Purpose

Execute dismiss on $&Toast. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

int — a value of this type

($&Toast) set_enabled

XuAPI
pub fn (t $&Toast) set_enabled(enabled bool) int

Purpose

Operation on $&Toast: set enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Toast) set_focus

XuAPI
pub fn (t $&Toast) set_focus(focused bool,now time.Instant) int

Purpose

Operation on $&Toast: set focus. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
focused bool
focused (bool)
now time.Instant
now (time.Instant)

Returns

int — a value of this type

($&Toast) input

XuAPI
pub fn (t $&Toast) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Toast) route

XuAPI
pub fn (t $&Toast) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Toast) tick

XuAPI
pub fn (t $&Toast) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

(&Toast) next_tick

XuAPI
pub fn (t &Toast) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Toast: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Toast
The Toast instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

(&Toast) paint_styled

XuAPI
pub fn (t &Toast) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Toast: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Toast
The Toast instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Toast) paint_content_styled

XuAPI
pub fn (t $&Toast) paint_content_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Toast: paint content styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Toast) paint_aux_text

XuAPI
pub fn (t $&Toast) paint_aux_text(frame $&draw.Frame,bounds &layout.Rect,styles &Styles) int

Purpose

Operation on $&Toast: paint aux text. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Toast) paint_popup_styled

XuAPI
pub fn (t $&Toast) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Toast: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&Toast) style_or

XuAPI
pub fn (t &Toast) style_or(styles &Styles) ControlStyle

Purpose

Operation on &Toast: style or.

Parameters

t &Toast
The Toast instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&Toast) set_style

XuAPI
pub fn (t $&Toast) set_style(style &ControlStyle) int

Purpose

Operation on $&Toast: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Toast) set_motion

XuAPI
pub fn (t $&Toast) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Toast: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Toast
The Toast instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

const NOTICE_NORMAL

XuAPI
pub const NOTICE_NORMAL = 0

Purpose

Constant NOTICE_NORMAL, defining protocol or algorithm parameters.

const NOTICE_IMPORTANT

XuAPI
pub const NOTICE_IMPORTANT = 1

Purpose

Constant NOTICE_IMPORTANT, defining protocol or algorithm parameters.

const ACTION_NOTICE_ACTION

XuAPI
pub const ACTION_NOTICE_ACTION = 9

Purpose

Constant ACTION_NOTICE_ACTION, defining protocol or algorithm parameters.

See usage example

struct Notice

XuAPI
pub struct Notice {
    pub key string
    pub text string
    pub action string
    pub lifetime time.Duration
    pub priority int
}

Purpose

Structure encapsulating key, text, action, lifetime, priority.

Public fields

key string
key
text string
text
action string
field (string)
lifetime time.Duration
field (time.Duration)
priority int
field (int)

notice

XuAPI
pub fn notice(text &string) Notice

Purpose

Execute notice.

Parameters

text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

Notice — a value of this type

See usage example

struct NoticeRecord

XuAPI
pub struct NoticeRecord {
    pub token int
    pub key string
    pub text string
    pub action string
    pub lifetime time.Duration
    pub priority int
}

Purpose

Structure encapsulating token, key, text, action, lifetime.

Public fields

token int
field (int)
key string
key
text string
text
action string
field (string)
lifetime time.Duration
field (time.Duration)
priority int
field (int)

struct ToastHost

XuAPI
pub struct ToastHost {

}

Purpose

Bounded, stable-priority queue. Expiry starts when a renderer displays a record, never while it is waiting. Keys replace pending copies in place.

Public fields

This type has no public fields.

toast_host

XuAPI
pub fn toast_host() ToastHost

Purpose

Toast host.

Parameters

No arguments are required.

Returns

ToastHost — a value of this type

(&ToastHost) pending_count

XuAPI
pub fn (host &ToastHost) pending_count() int

Purpose

Operation on &ToastHost: pending count.

Parameters

host &ToastHost
The ToastHost instance used by this call (borrow).

Returns

int — a value of this type

($&ToastHost) set_capacity

XuAPI
pub fn (host $&ToastHost) set_capacity(capacity int) int

Purpose

Operation on $&ToastHost: set capacity. Throws on failure; handle the error or propagate it to the caller.

Parameters

host $&ToastHost
The ToastHost instance used by this call (exclusive borrow).
capacity int
capacity (int)

Returns

int — a value of this type

($&ToastHost) enqueue

XuAPI
pub fn (host $&ToastHost) enqueue(value &Notice) int

Purpose

Execute enqueue on $&ToastHost. Throws on failure; handle the error or propagate it to the caller.

Parameters

host $&ToastHost
The ToastHost instance used by this call (exclusive borrow).
value &Notice
value (read-only borrow; caller keeps the original; type &Notice)

Returns

int — a value of this type

($&ToastHost) next_notice

XuAPI
pub fn (host $&ToastHost) next_notice() NoticeRecord

Purpose

Operation on $&ToastHost: next notice. Throws on failure; handle the error or propagate it to the caller.

Parameters

host $&ToastHost
The ToastHost instance used by this call (exclusive borrow).

Returns

NoticeRecord — a value of this type

($&Screen) enqueue_notice

XuAPI
pub fn (s $&Screen) enqueue_notice(value &Notice) int

Purpose

Returns a notice token; ACTION_NOTICE_ACTION carries this token in value. At most three toast controls are allocated for the lifetime of a Screen. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Screen
The Screen instance used by this call (exclusive borrow).
value &Notice
value (read-only borrow; caller keeps the original; type &Notice)

Returns

int — a value of this type

(&Screen) notice_ids

XuAPI
pub fn (s &Screen) notice_ids() []int

Purpose

Stable control IDs allocated lazily by enqueue_notice. The caller owns the returned snapshot and can register notice actions without borrowing Screen.

Parameters

s &Screen
The Screen instance used by this call (borrow).

Returns

[]int — slice result

struct Tooltip

XuAPI
pub struct Tooltip {

}

Purpose

The host forwards anchor pointer/focus events and calls tick at next_tick. No polling task is started. Geometry is in full canvas coordinates.

Public fields

This type has no public fields.

tooltip

XuAPI
pub fn tooltip(identity &ui.CanvasEvent,id int,anchor &layout.Rect,size &layout.Size,viewport &layout.Rect) Tooltip

Purpose

Execute tooltip. Throws on failure; handle the error or propagate it to the caller.

Parameters

identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
anchor &layout.Rect
anchor (read-only borrow; caller keeps the original; type &layout.Rect)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

Tooltip — a value of this type

(&Tooltip) id

XuAPI
pub fn (t &Tooltip) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

int — a value of this type

(&Tooltip) bounds

XuAPI
pub fn (t &Tooltip) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Tooltip) is_enabled

XuAPI
pub fn (t &Tooltip) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

bool — true or false

(&Tooltip) is_selectable

XuAPI
pub fn (t &Tooltip) is_selectable() bool

Purpose

Operation on &Tooltip: whether it is selectable.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

bool — true or false

($&Tooltip) set_selectable

XuAPI
pub fn (t $&Tooltip) set_selectable(selectable bool)

Purpose

Operation on $&Tooltip: set selectable.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

($&Tooltip) set_text

XuAPI
pub fn (t $&Tooltip) set_text(context &draw.Context,text &string) int

Purpose

Operation on $&Tooltip: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

(&Tooltip) has_popup_open

XuAPI
pub fn (t &Tooltip) has_popup_open() bool

Purpose

Operation on &Tooltip: whether it has popup open.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

bool — true or false

(&Tooltip) popup_bounds

XuAPI
pub fn (t &Tooltip) popup_bounds() layout.Rect

Purpose

Operation on &Tooltip: popup bounds.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&Tooltip) selected_text

XuAPI
pub fn (t &Tooltip) selected_text() string

Purpose

Operation on &Tooltip: selected text.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

string — result string

(&Tooltip) copy_selection

XuAPI
pub fn (t &Tooltip) copy_selection() int

Purpose

Operation on &Tooltip: copy selection.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

int — a value of this type

(&Tooltip) cursor

XuAPI
pub fn (t &Tooltip) cursor() int

Purpose

Execute cursor on &Tooltip.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

int — a value of this type

($&Tooltip) set_viewport

XuAPI
pub fn (t $&Tooltip) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&Tooltip: set viewport.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&Tooltip) set_locale

XuAPI
pub fn (t $&Tooltip) set_locale(locale &Locale) int

Purpose

Operation on $&Tooltip: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

(&Tooltip) is_open

XuAPI
pub fn (t &Tooltip) is_open() bool

Purpose

Return whether the overlay, menu or dialog is currently open.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

bool — true or false

(&Tooltip) is_visible

XuAPI
pub fn (t &Tooltip) is_visible() bool

Purpose

Operation on &Tooltip: whether it is visible.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

bool — true or false

(&Tooltip) opacity

XuAPI
pub fn (t &Tooltip) opacity() f64

Purpose

Execute opacity on &Tooltip.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

f64 — a value of this type

(&Tooltip) needs_paint

XuAPI
pub fn (t &Tooltip) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).

Returns

bool — true or false

($&Tooltip) painted

XuAPI
pub fn (t $&Tooltip) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&Tooltip) set_delay

XuAPI
pub fn (t $&Tooltip) set_delay(delay time.Duration) int

Purpose

Operation on $&Tooltip: set delay. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
delay time.Duration
delay (time.Duration)

Returns

int — a value of this type

($&Tooltip) set_geometry

XuAPI
pub fn (t $&Tooltip) set_geometry(anchor &layout.Rect,size &layout.Size,viewport &layout.Rect) int

Purpose

Operation on $&Tooltip: set geometry. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
anchor &layout.Rect
anchor (read-only borrow; caller keeps the original; type &layout.Rect)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&Tooltip) set_placement

XuAPI
pub fn (t $&Tooltip) set_placement(placement &OverlayPlacement) int

Purpose

Operation on $&Tooltip: set placement. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
placement &OverlayPlacement
placement (read-only borrow; caller keeps the original; type &OverlayPlacement)

Returns

int — a value of this type

($&Tooltip) set_enabled

XuAPI
pub fn (t $&Tooltip) set_enabled(enabled bool) int

Purpose

Operation on $&Tooltip: set enabled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

int — a value of this type

($&Tooltip) set_blocked

XuAPI
pub fn (t $&Tooltip) set_blocked(blocked bool,now time.Instant) int

Purpose

Interactive surfaces take priority over passive help. Suspend immediately, retain the logical trigger, and require a fresh delay when the surface exits. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
blocked bool
blocked (bool)
now time.Instant
now (time.Instant)

Returns

int — a value of this type

($&Tooltip) set_focus

XuAPI
pub fn (t $&Tooltip) set_focus(focused bool,now time.Instant) int

Purpose

Operation on $&Tooltip: set focus. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
focused bool
focused (bool)
now time.Instant
now (time.Instant)

Returns

int — a value of this type

($&Tooltip) dismiss

XuAPI
pub fn (t $&Tooltip) dismiss(now time.Instant,reduced_motion bool) int

Purpose

Execute dismiss on $&Tooltip. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

int — a value of this type

($&Tooltip) input

XuAPI
pub fn (t $&Tooltip) input(event &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Tooltip) route

XuAPI
pub fn (t $&Tooltip) route(kind int,event &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
kind int
kind tag (int)
event &ui.InputEvent
event (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Tooltip) tick

XuAPI
pub fn (t $&Tooltip) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

(&Tooltip) next_tick

XuAPI
pub fn (t &Tooltip) next_tick(now time.Instant) time.Instant

Purpose

Operation on &Tooltip: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

(&Tooltip) paint_styled

XuAPI
pub fn (t &Tooltip) paint_styled(frame $&draw.Frame,label $&StyledLabel,styles &Styles) int

Purpose

Operation on &Tooltip: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &Tooltip
The Tooltip instance used by this call (borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
label $&StyledLabel
label (exclusive borrow; may modify the original; type $&StyledLabel)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Tooltip) paint_content_styled

XuAPI
pub fn (t $&Tooltip) paint_content_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Tooltip: paint content styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Tooltip) paint_popup_styled

XuAPI
pub fn (t $&Tooltip) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&Tooltip: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&Tooltip) set_style

XuAPI
pub fn (t $&Tooltip) set_style(style &ControlStyle) int

Purpose

Operation on $&Tooltip: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&Tooltip) set_motion

XuAPI
pub fn (t $&Tooltip) set_motion(spec &MotionSpec) int

Purpose

Operation on $&Tooltip: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tooltip
The Tooltip instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

const ACTION_ITEM_ACTION

XuAPI
pub const ACTION_ITEM_ACTION = 6

Purpose

Constant ACTION_ITEM_ACTION, defining protocol or algorithm parameters.

See usage example

($&TreeView) set_appearance

XuAPI
pub fn (t $&TreeView) set_appearance(a &TreeAppearance) int

Purpose

Operation on $&TreeView: set appearance. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
a &TreeAppearance
value (read-only borrow; caller keeps the original; type &TreeAppearance)

Returns

int — a value of this type

($&TreeView) set_motion

XuAPI
pub fn (t $&TreeView) set_motion(spec &MotionSpec) int

Purpose

Operation on $&TreeView: set motion. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
spec &MotionSpec
spec (read-only borrow; caller keeps the original; type &MotionSpec)

Returns

int — a value of this type

($&TreeView) set_metadata

XuAPI
pub fn (t $&TreeView) set_metadata(node int,text &string) int

Purpose

Operation on $&TreeView: set metadata. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
node int
node (int)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&TreeView) set_icon

XuAPI
pub fn (t $&TreeView) set_icon(node int,icon int) int

Purpose

Operation on $&TreeView: set icon. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
node int
node (int)
icon int
icon (int)

Returns

int — a value of this type

($&TreeView) set_action

XuAPI
pub fn (t $&TreeView) set_action(node int,enabled bool) int

Purpose

Operation on $&TreeView: set action. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
node int
node (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&TreeView) begin_update

XuAPI
pub fn (t $&TreeView) begin_update() int

Purpose

Operation on $&TreeView: begin update. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TreeView) end_update

XuAPI
pub fn (t $&TreeView) end_update() int

Purpose

Operation on $&TreeView: end update. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TreeView) set_filter

XuAPI
pub fn (t $&TreeView) set_filter(query &string) int

Purpose

Operation on $&TreeView: set filter. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
query &string
query (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&TreeView) reveal_selected

XuAPI
pub fn (t $&TreeView) reveal_selected() int

Purpose

Operation on $&TreeView: reveal selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TreeView) find_next

XuAPI
pub fn (t $&TreeView) find_next(prefix &string) bool

Purpose

Unicode committed text can be passed by the application; raw key events are used only for ASCII type-ahead, never for IME composition. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
prefix &string
prefix (read-only borrow; caller keeps the original; type &string)

Returns

bool — true or false

($&TreeView) tick

XuAPI
pub fn (t $&TreeView) tick(now time.Instant,reduced_motion bool) bool

Purpose

Advance animation clock and state transition step. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
now time.Instant
now (time.Instant)
reduced_motion bool
reduced_motion (bool)

Returns

bool — true or false

(&TreeView) next_tick

XuAPI
pub fn (t &TreeView) next_tick(now time.Instant) time.Instant

Purpose

Operation on &TreeView: next tick. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
now time.Instant
now (time.Instant)

Returns

time.Instant — a value of this type

(&TreeView) action_bounds

XuAPI
pub fn (t &TreeView) action_bounds(row int) layout.Rect

Purpose

Operation on &TreeView: action bounds.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
row int
row (int)

Returns

layout.Rect — a value of this type

($&TreeView) row_label_rect

XuAPI
pub fn (t $&TreeView) row_label_rect(row int,c &ControlStyle,styles &Styles) layout.Rect

Purpose

Operation on $&TreeView: row label rectangle.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
row int
row (int)
c &ControlStyle
byte or character code (read-only borrow; caller keeps the original; type &ControlStyle)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Rect — a value of this type

($&TreeView) paint_styled

XuAPI
pub fn (t $&TreeView) paint_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&TreeView: paint styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

struct TreeView

XuAPI
pub struct TreeView {

}

Purpose

Up to 512 nodes, depth <= 32. add(-1, label) appends a root; other parents must be an earlier node index. Indices stay stable until clear. Children are shown in insertion order, even when they are appended after siblings.

Public fields

This type has no public fields.

tree_view

XuAPI
pub fn tree_view(context &draw.Context,identity &ui.CanvasEvent,id int,bounds &layout.Rect) TreeView

Purpose

Tree view. Throws on failure; handle the error or propagate it to the caller.

Parameters

context &draw.Context
context (read-only borrow; caller keeps the original; type &draw.Context)
identity &ui.CanvasEvent
identity (read-only borrow; caller keeps the original; type &ui.CanvasEvent)
id int
id (int)
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

TreeView — a value of this type

(&TreeView) id

XuAPI
pub fn (t &TreeView) id() int

Purpose

Return the unique integer ID of the element or control.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

int — a value of this type

(&TreeView) bounds

XuAPI
pub fn (t &TreeView) bounds() layout.Rect

Purpose

Return the bounding Rectangle of the control or geometry.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&TreeView) count

XuAPI
pub fn (t &TreeView) count() int

Purpose

Return the number of items in this control.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

int — a value of this type

(&TreeView) visible_count

XuAPI
pub fn (t &TreeView) visible_count() int

Purpose

Operation on &TreeView: visible count.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

int — a value of this type

(&TreeView) selected

XuAPI
pub fn (t &TreeView) selected() int

Purpose

Get or test the currently selected index, node, or state.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

int — a value of this type

(&TreeView) is_expanded

XuAPI
pub fn (t &TreeView) is_expanded(node int) bool

Purpose

Operation on &TreeView: whether it is expanded. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
node int
node (int)

Returns

bool — true or false

(&TreeView) parent

XuAPI
pub fn (t &TreeView) parent(node int) int

Purpose

Execute parent on &TreeView. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
node int
node (int)

Returns

int — a value of this type

(&TreeView) text

XuAPI
pub fn (t &TreeView) text(node int) string

Purpose

Operation on &TreeView: return the current text. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
node int
node (int)

Returns

string — result string

(&TreeView) visible_node

XuAPI
pub fn (t &TreeView) visible_node(index int) int

Purpose

Operation on &TreeView: visible node. Throws on failure; handle the error or propagate it to the caller.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
index int
index (int)

Returns

int — a value of this type

(&TreeView) needs_paint

XuAPI
pub fn (t &TreeView) needs_paint() bool

Purpose

Return whether the control needs repainting; call painted after painting to clear the flag.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

bool — true or false

($&TreeView) painted

XuAPI
pub fn (t $&TreeView) painted()

Purpose

Acknowledge the painted frame and clear the dirty flag; this is not a query.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

(&TreeView) is_selectable

XuAPI
pub fn (t &TreeView) is_selectable() bool

Purpose

Operation on &TreeView: whether it is selectable.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

bool — true or false

($&TreeView) set_selectable

XuAPI
pub fn (t $&TreeView) set_selectable(selectable bool)

Purpose

Operation on $&TreeView: set selectable.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
selectable bool
selectable (bool)

Returns

This call does not return a value.

(&TreeView) has_popup_open

XuAPI
pub fn (t &TreeView) has_popup_open() bool

Purpose

Operation on &TreeView: whether it has popup open.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

bool — true or false

(&TreeView) popup_bounds

XuAPI
pub fn (t &TreeView) popup_bounds() layout.Rect

Purpose

Operation on &TreeView: popup bounds.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

layout.Rect — a value of this type

(&TreeView) selected_text

XuAPI
pub fn (t &TreeView) selected_text() string

Purpose

Operation on &TreeView: selected text.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

string — result string

($&TreeView) set_locale

XuAPI
pub fn (t $&TreeView) set_locale(locale &Locale) int

Purpose

Operation on $&TreeView: set locale. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
locale &Locale
locale (read-only borrow; caller keeps the original; type &Locale)

Returns

int — a value of this type

($&TreeView) set_viewport

XuAPI
pub fn (t $&TreeView) set_viewport(viewport &layout.Rect)

Purpose

Operation on $&TreeView: set viewport.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
viewport &layout.Rect
viewport (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

This call does not return a value.

($&TreeView) paint_popup_styled

XuAPI
pub fn (t $&TreeView) paint_popup_styled(frame $&draw.Frame,styles &Styles) int

Purpose

Operation on $&TreeView: paint popup styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&TreeView) cursor

XuAPI
pub fn (t &TreeView) cursor() int

Purpose

Execute cursor on &TreeView.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

int — a value of this type

(&TreeView) is_enabled

XuAPI
pub fn (t &TreeView) is_enabled() bool

Purpose

Return whether the control is currently enabled.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

bool — true or false

(&TreeView) is_focused

XuAPI
pub fn (t &TreeView) is_focused() bool

Purpose

Return whether the control currently has input focus.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

bool — true or false

(&TreeView) is_read_only

XuAPI
pub fn (t &TreeView) is_read_only() bool

Purpose

Operation on &TreeView: whether it is read only.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

bool — true or false

(&TreeView) scroll_offset

XuAPI
pub fn (t &TreeView) scroll_offset() f64

Purpose

Operation on &TreeView: scroll offset.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).

Returns

f64 — a value of this type

($&TreeView) cancel

XuAPI
pub fn (t $&TreeView) cancel()

Purpose

Execute cancel on $&TreeView.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TreeView) set_focus

XuAPI
pub fn (t $&TreeView) set_focus(focused bool)

Purpose

Operation on $&TreeView: set focus.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
focused bool
focused (bool)

Returns

This call does not return a value.

($&TreeView) set_enabled

XuAPI
pub fn (t $&TreeView) set_enabled(enabled bool)

Purpose

Operation on $&TreeView: set enabled.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
enabled bool
enabled (bool)

Returns

This call does not return a value.

($&TreeView) set_read_only

XuAPI
pub fn (t $&TreeView) set_read_only(value bool) int

Purpose

Operation on $&TreeView: set read only. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
value bool
value (bool)

Returns

int — a value of this type

($&TreeView) add

XuAPI
pub fn (t $&TreeView) add(parent int,text &string) int

Purpose

Operation on $&TreeView: add. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
parent int
parent (int)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&TreeView) set_text

XuAPI
pub fn (t $&TreeView) set_text(node int,text &string) int

Purpose

Operation on $&TreeView: set text. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
node int
node (int)
text &string
text (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&TreeView) set_expanded

XuAPI
pub fn (t $&TreeView) set_expanded(node int,expanded bool) int

Purpose

Operation on $&TreeView: set expanded. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
node int
node (int)
expanded bool
expanded (bool)

Returns

int — a value of this type

($&TreeView) set_selected

XuAPI
pub fn (t $&TreeView) set_selected(node int) int

Purpose

Operation on $&TreeView: set selected. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
node int
node (int)

Returns

int — a value of this type

($&TreeView) clear

XuAPI
pub fn (t $&TreeView) clear() int

Purpose

Clear all buffered or stored entries and internal state. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&TreeView) set_bounds

XuAPI
pub fn (t $&TreeView) set_bounds(bounds &layout.Rect) int

Purpose

Operation on $&TreeView: set bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
bounds &layout.Rect
bounds (read-only borrow; caller keeps the original; type &layout.Rect)

Returns

int — a value of this type

($&TreeView) set_scroll_offset

XuAPI
pub fn (t $&TreeView) set_scroll_offset(offset f64) int

Purpose

Operation on $&TreeView: set scroll offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
offset f64
offset (f64)

Returns

int — a value of this type

(&TreeView) style_or

XuAPI
pub fn (t &TreeView) style_or(styles &Styles) ControlStyle

Purpose

Operation on &TreeView: style or.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

ControlStyle — a value of this type

($&TreeView) set_style

XuAPI
pub fn (t $&TreeView) set_style(style &ControlStyle) int

Purpose

Operation on $&TreeView: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
style &ControlStyle
style (read-only borrow; caller keeps the original; type &ControlStyle)

Returns

int — a value of this type

($&TreeView) clear_style

XuAPI
pub fn (t $&TreeView) clear_style()

Purpose

Operation on $&TreeView: clear style.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&TreeView) apply_styles

XuAPI
pub fn (t $&TreeView) apply_styles(styles &Styles) int

Purpose

Resolve and apply theme metrics to the control. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&TreeView) row_bounds

XuAPI
pub fn (t &TreeView) row_bounds(index int) layout.Rect

Purpose

Operation on &TreeView: row bounds.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
index int
index (int)

Returns

layout.Rect — a value of this type

(&TreeView) node_row_text

XuAPI
pub fn (t &TreeView) node_row_text(node int) string

Purpose

Operation on &TreeView: node row text.

Parameters

t &TreeView
The TreeView instance used by this call (borrow).
node int
node (int)

Returns

string — result string

($&TreeView) input

XuAPI
pub fn (t $&TreeView) input(input &ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TreeView) route

XuAPI
pub fn (t $&TreeView) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TreeView) event

XuAPI
pub fn (t $&TreeView) event(event &ui.Event) Action

Purpose

Handle and respond to window or system lifecycle and interaction events. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

Action — input result with kind, id, repaint and focus requests.

($&TreeView) measure_styled

XuAPI
pub fn (t $&TreeView) measure_styled(styles &Styles) layout.Size

Purpose

Operation on $&TreeView: measure styled. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

($&TreeView) dispose

XuAPI
pub fn (t $&TreeView) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

t $&TreeView
The TreeView instance used by this call (exclusive borrow).

Returns

This call does not return a value.

struct@ Painter

XuAPI
pub struct@ Painter {
    fn paint(int,&layout.Rect,$&draw.Frame) bool
}

Purpose

Method-set constraint Painter.

Required methods

paint fn paint(int,&layout.Rect,$&draw.Frame) bool
Paint the control visually onto the target canvas.

(Painter) paint

XuAPI
fn paint(int,&layout.Rect,$&draw.Frame) bool

Purpose

Paint the control visually onto the target canvas.

Parameters

self Self
The Self instance used by this call (value receiver).
int int
int (int)
rect &layout.Rect
rect (read-only borrow; caller keeps the original; type &layout.Rect)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)

Returns

bool — true or false

struct ViewStats

XuAPI
pub struct ViewStats {
    pub measured int
    pub reused_layouts int
    pub painted_nodes int
    pub recorded_boundaries int
    pub reused_boundaries int
    pub frame_commands int
}

Purpose

Structure encapsulating measured, reused_layouts, painted_nodes, recorded_boundaries, reused_boundaries.

Public fields

measured int
field (int)
reused_layouts int
field (int)
painted_nodes int
field (int)
recorded_boundaries int
field (int)
reused_boundaries int
field (int)
frame_commands int
field (int)

struct View

XuAPI
pub struct View {

}

Purpose

One retained scene per canvas. The application keeps its control/model state this owner keeps stable topology, measured geometry and vector paint caches. Paint callbacks receive node-local bounds, in the same logical coordinate system returned by local_input. They must not mutate the View or topology.

Public fields

This type has no public fields.

See usage example

(&Host) view

XuAPI
pub fn (host &Host) view(root_style &layout.BoxStyle,background draw.Color) View

Purpose

Operation on &Host: view. Throws on failure; handle the error or propagate it to the caller.

Parameters

host &Host
The Host instance used by this call (borrow).
root_style &layout.BoxStyle
root_style (read-only borrow; caller keeps the original; type &layout.BoxStyle)
background draw.Color
background (draw.Color)

Returns

View — a value of this type

(&View) root

XuAPI
pub fn (view &View) root() int

Purpose

Execute root on &View.

Parameters

view &View
The View instance used by this call (borrow).

Returns

int — a value of this type

($&View) add

XuAPI
pub fn (view $&View) add(parent int,style &layout.BoxStyle,intrinsic &layout.Size) int

Purpose

Operation on $&View: add. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
parent int
parent (int)
style &layout.BoxStyle
style (read-only borrow; caller keeps the original; type &layout.BoxStyle)
intrinsic &layout.Size
intrinsic (read-only borrow; caller keeps the original; type &layout.Size)

Returns

int — a value of this type

(&View) contains

XuAPI
pub fn (view &View) contains(id int) bool

Purpose

Operation on &View: report whether the input contains the given piece.

Parameters

view &View
The View instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

(&View) style

XuAPI
pub fn (view &View) style(id int) layout.BoxStyle

Purpose

Execute style on &View. Throws on failure; handle the error or propagate it to the caller.

Parameters

view &View
The View instance used by this call (borrow).
id int
id (int)

Returns

layout.BoxStyle — a value of this type

($&View) set_style

XuAPI
pub fn (view $&View) set_style(id int,style &layout.BoxStyle) int

Purpose

Operation on $&View: set style. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
style &layout.BoxStyle
style (read-only borrow; caller keeps the original; type &layout.BoxStyle)

Returns

int — a value of this type

($&View) set_intrinsic

XuAPI
pub fn (view $&View) set_intrinsic(id int,size &layout.Size) int

Purpose

Operation on $&View: set intrinsic. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
size &layout.Size
size (read-only borrow; caller keeps the original; type &layout.Size)

Returns

int — a value of this type

($&View) mark_paint

XuAPI
pub fn (view $&View) mark_paint(id int) int

Purpose

Operation on $&View: mark paint. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&View) set_offset

XuAPI
pub fn (view $&View) set_offset(id int,x f64,y f64) int

Purpose

Operation on $&View: set offset. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&View) set_scroll

XuAPI
pub fn (view $&View) set_scroll(id int,x f64,y f64) int

Purpose

Scroll clamps its model offset to the content/viewport extent. Apply that value here after dispatch; the same translation drives paint and hit testing. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

($&View) set_boundary

XuAPI
pub fn (view $&View) set_boundary(id int,enabled bool) int

Purpose

Operation on $&View: set boundary. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

($&View) remove

XuAPI
pub fn (view $&View) remove(id int) int

Purpose

Operation on $&View: remove. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

($&View) dispose

XuAPI
pub fn (view $&View) dispose()

Purpose

Release and dispose native resources and underlying handles.

Parameters

view $&View
The View instance used by this call (exclusive borrow).

Returns

This call does not return a value.

($&View) event

XuAPI
pub fn (view $&View) event(event &ui.Event) bool

Purpose

Call from the owning window's event loop. Closing another window or a stale generation does not revoke this scene. Focus/editor cancellation is handled by the application's control state before/alongside this lifecycle hook. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)

Returns

bool — true or false

($&View) set_background

XuAPI
pub fn (view $&View) set_background(color draw.Color)

Purpose

Operation on $&View: set background.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
color draw.Color
color (draw.Color)

Returns

This call does not return a value.

(&View) needs_frame

XuAPI
pub fn (view &View) needs_frame() bool

Purpose

Operation on &View: needs frame.

Parameters

view &View
The View instance used by this call (borrow).

Returns

bool — true or false

($&View) layout

XuAPI
pub fn (view $&View) layout(constraints &layout.Constraints) layout.Size

Purpose

Execute layout on $&View. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
constraints &layout.Constraints
constraints (read-only borrow; caller keeps the original; type &layout.Constraints)

Returns

layout.Size — a value of this type

(&View) node_bounds

XuAPI
pub fn (view &View) node_bounds(id int) layout.Rect

Purpose

Operation on &View: node bounds. Throws on failure; handle the error or propagate it to the caller.

Parameters

view &View
The View instance used by this call (borrow).
id int
id (int)

Returns

layout.Rect — a value of this type

(&View) hit_test

XuAPI
pub fn (view &View) hit_test(x f64,y f64) int

Purpose

Operation on &View: hit test. Throws on failure; handle the error or propagate it to the caller.

Parameters

view &View
The View instance used by this call (borrow).
x f64
value (f64)
y f64
value (f64)

Returns

int — a value of this type

(&View) local_input

XuAPI
pub fn (view &View) local_input(id int,input &ui.InputEvent) ui.InputEvent

Purpose

Pointer capture/focus policy belongs to the controls. Route captured releases through this same transform even when hit_test returns a different node. Throws on failure; handle the error or propagate it to the caller.

Parameters

view &View
The View instance used by this call (borrow).
id int
id (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

ui.InputEvent — a value of this type

(&View) stats

XuAPI
pub fn (view &View) stats() ViewStats

Purpose

Execute stats on &View.

Parameters

view &View
The View instance used by this call (borrow).

Returns

ViewStats — a value of this type

present

XuAPI
pub fn present#P:Painter(view $&View,constraints &layout.Constraints,painter $&P) bool

Purpose

Returns false without recording/submitting when layout and scene are current. A successful return acknowledges only the View. Control owners call painted after true; failed submissions keep the newly prepared records for cheap retry. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
constraints &layout.Constraints
constraints (read-only borrow; caller keeps the original; type &layout.Constraints)
painter $&P
painter (exclusive borrow; may modify the original; type $&P)

Returns

bool — true or false

See usage example

snapshot

XuAPI
pub fn snapshot#P:Painter(view $&View,constraints &layout.Constraints,scale f64,painter $&P) draw.Surface

Purpose

Export the same measured/recorded scene through the native Surface backend. Snapshotting does not acknowledge presentation to the window. A later present can reuse these records without invoking the painter again. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
constraints &layout.Constraints
constraints (read-only borrow; caller keeps the original; type &layout.Constraints)
scale f64
scale (f64)
painter $&P
painter (exclusive borrow; may modify the original; type $&P)

Returns

draw.Surface — a value of this type

const ROUTE_INPUT

XuAPI
pub const ROUTE_INPUT = 0

Purpose

Constant ROUTE_INPUT, defining protocol or algorithm parameters.

const ROUTE_FOCUS

XuAPI
pub const ROUTE_FOCUS = 1

Purpose

Constant ROUTE_FOCUS, defining protocol or algorithm parameters.

const ROUTE_BLUR

XuAPI
pub const ROUTE_BLUR = 2

Purpose

Constant ROUTE_BLUR, defining protocol or algorithm parameters.

const ROUTE_CANCEL

XuAPI
pub const ROUTE_CANCEL = 3

Purpose

Constant ROUTE_CANCEL, defining protocol or algorithm parameters.

struct@ InputHandler

XuAPI
pub struct@ InputHandler {
    fn input(int,int,&ui.InputEvent) Action
}

Purpose

Method-set constraint InputHandler.

Required methods

input fn input(int,int,&ui.InputEvent) Action
Process routed mouse, keyboard, or touch input events.

(InputHandler) input

XuAPI
fn input(int,int,&ui.InputEvent) Action

Purpose

Process routed mouse, keyboard, or touch input events.

Parameters

self Self
The Self instance used by this call (value receiver).
int int
int (int)
int int
int (int)
inputEvent &ui.InputEvent
inputEvent (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Button) route

XuAPI
pub fn (button $&Button) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

button $&Button
The Button instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Checkbox) route

XuAPI
pub fn (checkbox $&Checkbox) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

checkbox $&Checkbox
The Checkbox instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Scroll) route

XuAPI
pub fn (scroll $&Scroll) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

scroll $&Scroll
The Scroll instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Switch) route

XuAPI
pub fn (sw $&Switch) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

sw $&Switch
The Switch instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Radio) route

XuAPI
pub fn (r $&Radio) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

r $&Radio
The Radio instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Slider) route

XuAPI
pub fn (s $&Slider) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

s $&Slider
The Slider instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Tabs) route

XuAPI
pub fn (t $&Tabs) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

t $&Tabs
The Tabs instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Select) route

XuAPI
pub fn (sel $&Select) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

sel $&Select
The Select instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&Stepper) route

XuAPI
pub fn (st $&Stepper) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

st $&Stepper
The Stepper instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&ListBox) route

XuAPI
pub fn (lb $&ListBox) route(kind int,input &ui.InputEvent) Action

Purpose

Route and dispatch the input event to matching targets. Throws on failure; handle the error or propagate it to the caller.

Parameters

lb $&ListBox
The ListBox instance used by this call (exclusive borrow).
kind int
kind tag (int)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)

Returns

Action — input result with kind, id, repaint and focus requests.

($&View) set_input

XuAPI
pub fn (view $&View) set_input(id int,enabled bool,focusable bool) int

Purpose

Keep this registration in sync with the model's enabled state. Focus order is tree order, and excludes hidden, fully clipped, zero-sized and disabled nodes. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)
focusable bool
focusable (bool)

Returns

int — a value of this type

($&View) set_capture_outside

XuAPI
pub fn (view $&View) set_capture_outside(id int,enabled bool) int

Purpose

Editors retain real drag coordinates outside their bounds. Buttons keep the clipped-hit policy so release through an occluder cannot activate them. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
enabled bool
enabled (bool)

Returns

int — a value of this type

(&View) focused

XuAPI
pub fn (view &View) focused() int

Purpose

Execute focused on &View.

Parameters

view &View
The View instance used by this call (borrow).

Returns

int — a value of this type

(&View) captured

XuAPI
pub fn (view &View) captured() int

Purpose

Execute captured on &View.

Parameters

view &View
The View instance used by this call (borrow).

Returns

int — a value of this type

(&View) pointer_cursor

XuAPI
pub fn (view &View) pointer_cursor() int

Purpose

Operation on &View: pointer cursor.

Parameters

view &View
The View instance used by this call (borrow).

Returns

int — a value of this type

($&View) set_cursor

XuAPI
pub fn (view $&View) set_cursor(id int,cursor int) int

Purpose

Operation on $&View: set cursor. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
cursor int
cursor (int)

Returns

int — a value of this type

($&View) set_pointer_cursor

XuAPI
pub fn (view $&View) set_pointer_cursor(cursor int) int

Purpose

Cursor commands are scoped to this canvas generation and deduplicated. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
cursor int
cursor (int)

Returns

int — a value of this type

flush_input

XuAPI
pub fn flush_input#H:InputHandler(view $&View,handler $&H) int

Purpose

Flush removed/disabled targets using their old, never-reused IDs. The model handler may still clear retired control state; it must ignore unknown IDs. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
handler $&H
handler (exclusive borrow; may modify the original; type $&H)

Returns

int — a value of this type

cancel_input

XuAPI
pub fn cancel_input#H:InputHandler(view $&View,handler $&H) int

Purpose

Cancel input. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
handler $&H
handler (exclusive borrow; may modify the original; type $&H)

Returns

int — a value of this type

dispatch

XuAPI
pub fn dispatch#H:InputHandler(view $&View,input &ui.InputEvent,handler $&H) []Action

Purpose

Returns semantic/consumed actions. Paint invalidation, hover, focus and primary pointer capture are maintained here; callbacks cannot mutate the View while it is borrowed. Apply effects on other model nodes after dispatch returns. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
input &ui.InputEvent
input (read-only borrow; caller keeps the original; type &ui.InputEvent)
handler $&H
handler (exclusive borrow; may modify the original; type $&H)

Returns

[]Action — slice result

See usage example

dispatch_event

XuAPI
pub fn dispatch_event#H:InputHandler(view $&View,event &ui.Event,handler $&H) []Action

Purpose

Dispatch event. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
event &ui.Event
event (read-only borrow; caller keeps the original; type &ui.Event)
handler $&H
handler (exclusive borrow; may modify the original; type $&H)

Returns

[]Action — slice result

See usage example

const THEME_DARK

XuAPI
pub const THEME_DARK = 0

Purpose

Constant THEME_DARK, defining protocol or algorithm parameters.

See usage example

const THEME_LIGHT

XuAPI
pub const THEME_LIGHT = 1

Purpose

Constant THEME_LIGHT, defining protocol or algorithm parameters.

See usage example

const THEME_CONTRAST

XuAPI
pub const THEME_CONTRAST = 2

Purpose

Constant THEME_CONTRAST, defining protocol or algorithm parameters.

See usage example

preset_styles

XuAPI
pub fn preset_styles(preset int) Styles

Purpose

Preset styles. Throws on failure; handle the error or propagate it to the caller.

Parameters

preset int
preset (int)

Returns

Styles — a value of this type

See usage example

preset_name

XuAPI
pub fn preset_name(preset int) string

Purpose

Preset name. Throws on failure; handle the error or propagate it to the caller.

Parameters

preset int
preset (int)

Returns

string — result string

next_preset

XuAPI
pub fn next_preset(preset int) int

Purpose

Next preset. Throws on failure; handle the error or propagate it to the caller.

Parameters

preset int
preset (int)

Returns

int — a value of this type

struct StyleSwitcher

XuAPI
pub struct StyleSwitcher {

}

Purpose

StyleSwitcher context or state structure.

Public fields

This type has no public fields.

See usage example

style_switcher

XuAPI
pub fn style_switcher() StyleSwitcher

Purpose

Style switcher.

Parameters

No arguments are required.

Returns

StyleSwitcher — a value of this type

See usage example

(&StyleSwitcher) current

XuAPI
pub fn (switcher &StyleSwitcher) current() int

Purpose

Execute current on &StyleSwitcher.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).

Returns

int — a value of this type

(&StyleSwitcher) name

XuAPI
pub fn (switcher &StyleSwitcher) name() string

Purpose

Execute name on &StyleSwitcher.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).

Returns

string — result string

(&StyleSwitcher) count

XuAPI
pub fn (switcher &StyleSwitcher) count() int

Purpose

Return the number of items in this control.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).

Returns

int — a value of this type

(&StyleSwitcher) text_scale

XuAPI
pub fn (switcher &StyleSwitcher) text_scale() f64

Purpose

Operation on &StyleSwitcher: text scale.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).

Returns

f64 — a value of this type

(&StyleSwitcher) density

XuAPI
pub fn (switcher &StyleSwitcher) density() f64

Purpose

Execute density on &StyleSwitcher.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).

Returns

f64 — a value of this type

(&StyleSwitcher) styles

XuAPI
pub fn (switcher &StyleSwitcher) styles() Styles

Purpose

Execute styles on &StyleSwitcher.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).

Returns

Styles — a value of this type

($&StyleSwitcher) use_preset

XuAPI
pub fn (switcher $&StyleSwitcher) use_preset(index int) int

Purpose

Operation on $&StyleSwitcher: use preset. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
index int
index (int)

Returns

int — a value of this type

($&StyleSwitcher) use_name

XuAPI
pub fn (switcher $&StyleSwitcher) use_name(name &string) int

Purpose

Operation on $&StyleSwitcher: use name. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
name &string
name (read-only borrow; caller keeps the original; type &string)

Returns

int — a value of this type

($&StyleSwitcher) next

XuAPI
pub fn (switcher $&StyleSwitcher) next() int

Purpose

Operation on $&StyleSwitcher: take the next item, or end according to this type.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).

Returns

int — a value of this type

($&StyleSwitcher) set_text_scale

XuAPI
pub fn (switcher $&StyleSwitcher) set_text_scale(scale f64) int

Purpose

Operation on $&StyleSwitcher: set text scale. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
scale f64
scale (f64)

Returns

int — a value of this type

($&StyleSwitcher) set_density

XuAPI
pub fn (switcher $&StyleSwitcher) set_density(density f64) int

Purpose

Operation on $&StyleSwitcher: set density. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
density f64
density (f64)

Returns

int — a value of this type

($&StyleSwitcher) set_preset

XuAPI
pub fn (switcher $&StyleSwitcher) set_preset(index int,styles &Styles) int

Purpose

Operation on $&StyleSwitcher: set preset. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
index int
index (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

($&StyleSwitcher) add_preset

XuAPI
pub fn (switcher $&StyleSwitcher) add_preset(name &string,styles &Styles) int

Purpose

Operation on $&StyleSwitcher: add preset. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
name &string
name (read-only borrow; caller keeps the original; type &string)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

int — a value of this type

(&StyleSwitcher) apply

XuAPI
pub fn (switcher &StyleSwitcher) apply(view $&View) int

Purpose

Execute apply on &StyleSwitcher. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher &StyleSwitcher
The StyleSwitcher instance used by this call (borrow).
view $&View
view (exclusive borrow; may modify the original; type $&View)

Returns

int — a value of this type

($&StyleSwitcher) cycle

XuAPI
pub fn (switcher $&StyleSwitcher) cycle(view $&View) int

Purpose

Execute cycle on $&StyleSwitcher. Throws on failure; handle the error or propagate it to the caller.

Parameters

switcher $&StyleSwitcher
The StyleSwitcher instance used by this call (exclusive borrow).
view $&View
view (exclusive borrow; may modify the original; type $&View)

Returns

int — a value of this type

struct@ StyledPainter

XuAPI
pub struct@ StyledPainter {
    fn measure_styled(int,&Styles) layout.Size
    fn paint_styled(int,&layout.Rect,&Styles,$&draw.Frame) bool
    fn overlay_styled(int,&layout.Rect,&Styles,$&draw.Frame) bool
}

Purpose

Style-aware retained callbacks. Borrow the effective theme and paint in node-local coordinates. Do not mutate View or topology in callbacks. Overlay runs after children.

Required methods

measure_styled fn measure_styled(int,&Styles) layout.Size
Operation on StyledPainter: measure styled.
paint_styled fn paint_styled(int,&layout.Rect,&Styles,$&draw.Frame) bool
Operation on StyledPainter: paint styled.
overlay_styled fn overlay_styled(int,&layout.Rect,&Styles,$&draw.Frame) bool
Operation on StyledPainter: overlay styled.

(StyledPainter) measure_styled

XuAPI
fn measure_styled(int,&Styles) layout.Size

Purpose

Operation on StyledPainter: measure styled.

Parameters

self Self
The Self instance used by this call (value receiver).
int int
int (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

layout.Size — a value of this type

(StyledPainter) paint_styled

XuAPI
fn paint_styled(int,&layout.Rect,&Styles,$&draw.Frame) bool

Purpose

Operation on StyledPainter: paint styled.

Parameters

self Self
The Self instance used by this call (value receiver).
int int
int (int)
rect &layout.Rect
rect (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)

Returns

bool — true or false

(StyledPainter) overlay_styled

XuAPI
fn overlay_styled(int,&layout.Rect,&Styles,$&draw.Frame) bool

Purpose

Operation on StyledPainter: overlay styled.

Parameters

self Self
The Self instance used by this call (value receiver).
int int
int (int)
rect &layout.Rect
rect (read-only borrow; caller keeps the original; type &layout.Rect)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)
frame $&draw.Frame
frame (exclusive borrow; may modify the original; type $&draw.Frame)

Returns

bool — true or false

(&View) styles

XuAPI
pub fn (view &View) styles() Styles

Purpose

Execute styles on &View. Throws on failure; handle the error or propagate it to the caller.

Parameters

view &View
The View instance used by this call (borrow).

Returns

Styles — a value of this type

(&View) has_style_scope

XuAPI
pub fn (view &View) has_style_scope(id int) bool

Purpose

Operation on &View: whether it has style scope. Throws on failure; handle the error or propagate it to the caller.

Parameters

view &View
The View instance used by this call (borrow).
id int
id (int)

Returns

bool — true or false

($&View) invalidate_control

XuAPI
pub fn (view $&View) invalidate_control(id int) int

Purpose

Operation on $&View: invalidate control. Throws on failure; handle the error or propagate it to the caller.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)

Returns

int — a value of this type

(&View) styles_for

XuAPI
pub fn (view &View) styles_for(id int) Styles

Purpose

Return an owned clone of the complete theme inherited by the node.

Parameters

view &View
The View instance used by this call (borrow).
id int
id (int)

Returns

owned Styles; throws for an invalid node

($&View) set_styles

XuAPI
pub fn (view $&View) set_styles(styles &Styles) int

Purpose

Set the root theme. Palette changes repaint; metric changes also remeasure registered nodes. Equal values are a no-op.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

($&View) set_style_scope

XuAPI
pub fn (view $&View) set_style_scope(id int,styles &Styles) int

Purpose

Store a complete theme snapshot on a non-root node, inherited until another scope. Later global changes preserve it.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
styles &Styles
styles (read-only borrow; caller keeps the original; type &Styles)

Returns

0 on success; throws on failure

($&View) clear_style_scope

XuAPI
pub fn (view $&View) clear_style_scope(id int) int

Purpose

Remove a local theme and restore inheritance, invalidating affected caches.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)

Returns

0 on success; throws on failure

($&View) set_style_measure

XuAPI
pub fn (view $&View) set_style_measure(id int,on bool) int

Purpose

Opt a node into StyledPainter.measure_styled; enabling marks measurement dirty.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)
on bool
on (bool)

Returns

0 on success; throws on failure

($&View) mark_measure

XuAPI
pub fn (view $&View) mark_measure(id int) int

Purpose

Call after text or intrinsic size changes; marks paint dirty and remeasures registered nodes.

Parameters

view $&View
The View instance used by this call (exclusive borrow).
id int
id (int)

Returns

0 on success; throws on failure

layout_styled

XuAPI
pub fn layout_styled#P:StyledPainter(view $&View,constraints &layout.Constraints,painter $&P) layout.Size

Purpose

Measure registered dirty nodes and run layout; synchronize editor placement afterward.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
constraints &layout.Constraints
constraints (read-only borrow; caller keeps the original; type &layout.Constraints)
painter $&P
painter (exclusive borrow; may modify the original; type $&P)

Returns

laid-out root size; throws on failure

See usage example

present_styled

XuAPI
pub fn present_styled#P:StyledPainter(view $&View,constraints &layout.Constraints,painter $&P) bool

Purpose

Lay out and present a dirty scene, reusing valid repaint boundaries; submit nothing when clean.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
constraints &layout.Constraints
constraints (read-only borrow; caller keeps the original; type &layout.Constraints)
painter $&P
painter (exclusive borrow; may modify the original; type $&P)

Returns

true when submitted, false when clean; throws on failure

See usage example

snapshot_styled

XuAPI
pub fn snapshot_styled#P:StyledPainter(view $&View,constraints &layout.Constraints,scale f64,painter $&P) draw.Surface

Purpose

Lay out and render into an offscreen Surface; scale selects raster resolution. The caller disposes the result.

Parameters

view $&View
view (exclusive borrow; may modify the original; type $&View)
constraints &layout.Constraints
constraints (read-only borrow; caller keeps the original; type &layout.Constraints)
scale f64
scale (f64)
painter $&P
painter (exclusive borrow; may modify the original; type $&P)

Returns

an owned Surface; throws on failure