ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1,019 B
Text
36 lines
1,019 B
Text
# screen_class.ludic - a Ludic component shown as a whole screen
|
|
# a Ludic component shown as a screen: an instance at the top, keyed by its name
|
|
function fr_class_nodes(ui_st: mut UiState, cls: UiClass) -> UiNode {
|
|
lc_begin(ui_st)
|
|
ui_st.in_build += 1
|
|
ui_st.ui_view = null
|
|
uc_load(ui_st, cls)
|
|
let root = fr_root(cls.name, cls.sheet)
|
|
let use = new UiTpl
|
|
use.tag = cls.name
|
|
use.cls = cls
|
|
use.keys = new []string
|
|
use.vals = new []UiExpr
|
|
use.on_keys = new []string
|
|
use.on_acts = new []UiAct
|
|
use.kids = new []UiTpl
|
|
let e = env_new(null)
|
|
e.model = Value.object()
|
|
root.env = e
|
|
bd_class(ui_st, use, e, cls.name, root.children)
|
|
in_sweep(ui_st, cls.name)
|
|
cs_tree(ui_st, root)
|
|
return root
|
|
}
|
|
function fr_root(key: string, sheet: UiSheet) -> UiNode {
|
|
let root = new UiNode
|
|
root.key = key
|
|
root.tag = "screen"
|
|
root.sheet = sheet
|
|
root.children = new []UiNode
|
|
root.classes = new []string
|
|
root.akeys = new []string
|
|
root.avals = new []string
|
|
root.vals = new []Val
|
|
return root
|
|
}
|