docs: clarify tool outputs and example window contexts

This commit is contained in:
2026-11-12 21:18:12 +08:00
parent ffc98fb657
commit c3e7d01c09
4 changed files with 10 additions and 4 deletions
+2 -1
View File
@@ -23,7 +23,8 @@ class WindowBand: RectBlock {
return MeasureResult(constraints.maxWidth, 32)
}
}
// ui.window 返回当前主窗口托管资源;page.open 指定同一资源,后面的 title/resize 为原生命令。
// 此文件顶层在默认主窗口上下文执行,ui.window() 因而取主窗口;事件/渲染回调中则跟随其当前窗口上下文。
// page.open 指定保存的同一资源,后面的 title/resize 为异步原生命令,不等于已改变原生实际尺寸。
window = ui.window()
actions = WindowActions(window)
band = WindowBand(80, 32, 0, "#237A45")
+2 -1
View File
@@ -22,7 +22,8 @@ right.title = "独立窗口页面"
right.render(Column(24,16,TextBlock("关闭窗口会解除 Page 归属,保留的对象仍可重开"),ui.textOf(count,"value"),rightButton))
// 把页面放到 other,上下文更换将重建出现位置,业务 count 仍不变。
right.open(other)
// open 把 right 归入副窗口;下面 ui.window() 仍用于源会话的主窗口,other 则显式选中副窗口资源。
// open 把 right 归入副窗口;它不把后续顶层执行上下文永久改为该窗口,下面 ui.window() 仍取默认主窗口。
// 若在副窗口事件回调里调用 ui.window(),则取该事件窗口;other 变量始终显式指向此处构造的副窗口资源。
// 窗口命令针对各自资源编号排队;成功输入后再交 GUI,另一窗口设置自己的尺寸。
ui.window().setTitle("Endor Main")
other.setTitle("Endor Shared")