Skip to main content

Module bind

Module bind 

Source
Expand description

Binding helpers used by generated .yui code: a Slot remembers a binding’s last value so widgets are only patched when it changes, and the conversion functions turn view-model values into widget values with readable compile errors.

Structs§

Slot
The last value of one binding.

Traits§

BindColor
A value used as a color by a .yui binding.
BindText
A value shown as text by a .yui binding.

Functions§

color
Color of a bound value.
count
A bound count (count); out-of-range values become 0.
flag
A bound flag (enabled, visible, checked).
is_selected
Whether the item with key is the selected one.
key
Hash of a bound key (key, scroll_key) — stable within a process.
number
A bound number (gap, font_scale, …).
set_checked
Sets or clears the CHECKED state (inherited by non-interactive children).
set_count
Sets the stack count of an inventory slot; false for other kinds.
set_item
Sets the item of an item slot / inventory slot; false for other kinds.
set_placeholder
Sets the placeholder of a text box; false for other kinds.
set_source
Sets the image source of an image or the id of a surface; false for other kinds.
text
Text of a bound value.
units
A bound size (w, h).