ui module

Maylang standard-library module.

import "ui" as ui;

Functions

light_theme

may
pub fun light_theme() -> Theme

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

dark_theme

may
pub fun dark_theme() -> Theme

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

node

may
fun node(kind: Str, id: Str, text: Str, children: List<Widget>) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

label

may
pub fun label(text: Str) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

button

may
pub fun button(id: Str, text: Str) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

entry

may
pub fun entry(id: Str, text: Str) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

upload_rgba

may
pub fun upload_rgba(pixels: Ptr, width: Int, height: Int) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

framebuffer

may
pub fun framebuffer(source_width: Int, source_height: Int, integer_scale: Bool) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

key_down

may
pub fun key_down(window: Window, key: Int) -> Bool

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

key_pressed

may
pub fun key_pressed(window: Window, key: Int) -> Bool

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

focused

may
pub fun focused(window: Window) -> Bool

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

placeholder

may
pub fun placeholder(item: Widget, hint: Str) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

checkbox

may
pub fun checkbox(id: Str, text: Str, checked: Bool) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

row

may
pub fun row(children: List<Widget>) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

column

may
pub fun column(children: List<Widget>) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

spacer

may
pub fun spacer(size: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

scroller

may
pub fun scroller(id: Str, child: Widget) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

size

may
pub fun size(item: Widget, width: Int, height: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

flex

may
pub fun flex(item: Widget, weight: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

spacing

may
pub fun spacing(item: Widget, padding: Int, gap: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

style

may
pub fun style(item: Widget, background: Int, foreground: Int, font: Int, radius: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

primary

may
pub fun primary(item: Widget) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

border

may
pub fun border(item: Widget, color: Int, width: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

elevated

may
pub fun elevated(item: Widget, level: Int) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

enabled

may
pub fun enabled(item: Widget, value: Bool) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

card

may
pub fun card(item: Widget) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

set_theme

may
pub fun set_theme(window: Window, theme: Theme) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

mix_color

may
fun mix_color(a: Int, b: Int, percent: Int) -> Int

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

open

may
pub fun open(title: Str, width: Int, height: Int, headless: Bool) -> Window

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

close

may
pub fun close(window: Window) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

focus

may
pub fun focus(window: Window, id: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

natural

may
fun natural(item: Widget, horizontal: Bool) -> Int

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

intersect

may
fun intersect(a: Rect, b: Rect) -> Rect

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

inside

may
fun inside(rect: Rect, x: Int, y: Int) -> Bool

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

clip

may
fun clip(rect: Rect) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

draw

may
fun draw(window: Window, item: Widget, rect: Rect, viewport: Rect, ids: Map<Str, Bool>) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

present

may
pub fun present(window: Window, root: Widget) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

virtual_list

may
pub fun virtual_list(window: Window, id: Str, count: Int, row_height: Int, make: Fn(Int) -> Widget) -> Widget

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

action

may
fun action(kind: Str, id: Str, text: Str, window: Window) -> Event

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

activate

may
fun activate(item: Widget, window: Window) -> Event

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

dispatch

may
pub fun dispatch(window: Window, kind: Int, a: Int, b: Int, modifiers: Int, text: Str) -> Event

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

poll

may
pub fun poll(window: Window) -> Event

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

poll_for

may
pub fun poll_for(window: Window, timeout_ms: Int) -> Event

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

snapshot

may
pub fun snapshot(window: Window, path: Str) -> Nil

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

pixel

may
pub fun pixel(window: Window, x: Int, y: Int) -> Int

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

renderer

may
pub fun renderer(window: Window) -> Str

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

render_stats

may
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

may
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

may
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

may
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

may
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

may
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

may
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

may
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

may
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

may
mut surface_active: Bool = false;

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source