ludic/packages/ludic.ui/screen_class.ludic

32 lines
944 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 {
pl_begin(ui_st, cls.name)
lc_begin(ui_st)
ui_st.in_build += 1
ui_st.ui_view = null
uc_load(ui_st, cls)
let root = fr_root(ui_st, 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(ui_st, 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(ui_st: mut UiState, key: string, sheet: UiSheet) -> UiNode {
let root = nd_take(ui_st)
root.key = key
root.tag = "screen"
root.sheet = sheet
return root
}