combined components work

This commit is contained in:
Andreas Rumpf 2017-06-28 12:56:51 +02:00
commit 4199c42e3b

View file

@ -58,8 +58,12 @@ proc renderComb(self: VComponent): VNode =
self.a self.a
self.b self.b
proc changed(self: VComponent): bool =
let self = Combined(self)
result = self.a.changedImpl(self.a) or self.b.changedImpl(self.b)
proc newCombined*(style: VStyle = VStyle()): Combined = proc newCombined*(style: VStyle = VStyle()): Combined =
result = newComponent(Combined, renderComb) result = newComponent(Combined, renderComb, changed=changed)
result.a = newTextInput(style, "AAA") result.a = newTextInput(style, "AAA")
result.b = newTextInput(style, "BBB") result.b = newTextInput(style, "BBB")