ui module
Maylang standard-library module.
import "ui" as ui;
Functions
light_theme
pub fun light_theme() -> ThemeNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
dark_theme
pub fun dark_theme() -> ThemeNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
node
fun node(kind: Str, id: Str, text: Str, children: List<Widget>) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
label
pub fun label(text: Str) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
button
pub fun button(id: Str, text: Str) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
entry
pub fun entry(id: Str, text: Str) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
upload_rgba
pub fun upload_rgba(pixels: Ptr, width: Int, height: Int) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
framebuffer
pub fun framebuffer(source_width: Int, source_height: Int, integer_scale: Bool) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
key_down
pub fun key_down(window: Window, key: Int) -> BoolNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
key_pressed
pub fun key_pressed(window: Window, key: Int) -> BoolNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
focused
pub fun focused(window: Window) -> BoolNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
placeholder
pub fun placeholder(item: Widget, hint: Str) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
checkbox
pub fun checkbox(id: Str, text: Str, checked: Bool) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
row
pub fun row(children: List<Widget>) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
column
pub fun column(children: List<Widget>) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
spacer
pub fun spacer(size: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
scroller
pub fun scroller(id: Str, child: Widget) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
size
pub fun size(item: Widget, width: Int, height: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
flex
pub fun flex(item: Widget, weight: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
spacing
pub fun spacing(item: Widget, padding: Int, gap: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
style
pub fun style(item: Widget, background: Int, foreground: Int, font: Int, radius: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
primary
pub fun primary(item: Widget) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
border
pub fun border(item: Widget, color: Int, width: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
elevated
pub fun elevated(item: Widget, level: Int) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
enabled
pub fun enabled(item: Widget, value: Bool) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
card
pub fun card(item: Widget) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
set_theme
pub fun set_theme(window: Window, theme: Theme) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
mix_color
fun mix_color(a: Int, b: Int, percent: Int) -> IntNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
open
pub fun open(title: Str, width: Int, height: Int, headless: Bool) -> WindowNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
close
pub fun close(window: Window) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
focus
pub fun focus(window: Window, id: Str) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
natural
fun natural(item: Widget, horizontal: Bool) -> IntNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
intersect
fun intersect(a: Rect, b: Rect) -> RectNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
inside
fun inside(rect: Rect, x: Int, y: Int) -> BoolNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
clip
fun clip(rect: Rect) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
draw
fun draw(window: Window, item: Widget, rect: Rect, viewport: Rect, ids: Map<Str, Bool>) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
present
pub fun present(window: Window, root: Widget) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
virtual_list
pub fun virtual_list(window: Window, id: Str, count: Int, row_height: Int, make: Fn(Int) -> Widget) -> WidgetNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
action
fun action(kind: Str, id: Str, text: Str, window: Window) -> EventNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
activate
fun activate(item: Widget, window: Window) -> EventNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
dispatch
pub fun dispatch(window: Window, kind: Int, a: Int, b: Int, modifiers: Int, text: Str) -> EventNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
poll
pub fun poll(window: Window) -> EventNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
poll_for
pub fun poll_for(window: Window, timeout_ms: Int) -> EventNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
snapshot
pub fun snapshot(window: Window, path: Str) -> NilNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
pixel
pub fun pixel(window: Window, x: Int, y: Int) -> IntNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
renderer
pub fun renderer(window: Window) -> StrNo description yet. Read the declaration source for the exact contract.
supported · full runtime · source
render_stats
pub fun render_stats(window: Window) -> Map<Str, Int>No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Types
Decoration
struct Decoration { border_color: Int, border_width: Int, elevation: Int, disabled: Bool }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Widget
pub struct Widget { kind: Str, id: Str, text: Str, hint: Str, children: List<Widget>, width: Int, height: Int, grow: Int, pad: Int, gap: Int, background: Int, foreground: Int, font: Int, radius: Int, checked: Bool, decoration: Decoration }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Rect
struct Rect { x: Int, y: Int, w: Int, h: Int }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Hit
struct Hit { item: Widget, rect: Rect, full: Rect, limit: Int }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Theme
pub struct Theme { background: Int, surface: Int, soft: Int, text: Int, muted: Int, accent: Int, on_accent: Int, border: Int }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Window
pub struct Window { width: Int, height: Int, headless: Bool, focus: Str, caret: Int, selected: Bool, mouse_x: Int, mouse_y: Int, scroll: Map<Str, Int>, hits: List<Hit>, root: Any, active: Bool, cursor: Int, theme: Theme, pressed: Str, keyboard_focus: Bool }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Event
pub struct Event { kind: Str, id: Str, text: Str, width: Int, height: Int }No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Constants
plain_decoration
let plain_decoration: Decoration = Decoration(-1, 0, 0, false);No description yet. Read the declaration source for the exact contract.
supported · full runtime · source
Mutable constants
surface_active
mut surface_active: Bool = false;No description yet. Read the declaration source for the exact contract.
supported · full runtime · source