feat: retain managed visual objects and dispatch native input through Endor
Verify Tessera GUI / verify (push) Successful in 9m28s

This commit is contained in:
2026-10-21 01:49:35 +08:00
parent 757fa22d9b
commit 0d5e4b318d
21 changed files with 3295 additions and 892 deletions
+28
View File
@@ -0,0 +1,28 @@
class Counter {
value: Number
lastEvent: String
function activate(self: Counter, event: Event): Unit {
self.lastEvent = event.kind
self.change()
}
function change(self: Counter): Unit {
self.value = 10
}
}
class DemoCounter: Counter {
function change(self: DemoCounter): Unit {
self.value = 12
}
}
model = DemoCounter(9, "等待点击")
first = ui.textOf(model, "value", 2)
second = ui.textOf(model, "value", 2)
eventName = ui.textOf(model, "lastEvent")
button = Button("调用继承方法,再分派到覆盖方法")
button.onClick(model.activate)
page = Page()
page.render(Column(24, 16, TextBlock("Endor class:继承、self 与动态方法分派", 2), Row(0, 16, first, second), button, eventName))