From 841e6252c95244f0ee7faf2c01d33f69a8ab483a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 17 Jan 2024 21:31:49 -0600 Subject: common tree package for toolkits This update provides *lots* of toolkit updates. This will allow the next step of debugging the gocui toolkit to make it work again. There are new common routines for handling the plugin channel communication Signed-off-by: Jeff Carr --- andlabs/checkbox.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'andlabs/checkbox.go') diff --git a/andlabs/checkbox.go b/andlabs/checkbox.go index d44e458..d447baf 100644 --- a/andlabs/checkbox.go +++ b/andlabs/checkbox.go @@ -1,23 +1,26 @@ package main import ( + "go.wit.com/gui/toolkits/tree" + "go.wit.com/dev/andlabs/ui" _ "go.wit.com/dev/andlabs/ui/winmanifest" ) -func (p *node) newCheckbox(n *node) { +func newCheckbox(p *tree.Node, n *tree.Node) { + if notNew(n) { return } newt := new(guiWidget) - newt.uiCheckbox = ui.NewCheckbox(n.label) + newt.uiCheckbox = ui.NewCheckbox(n.GetLabel()) newt.uiControl = newt.uiCheckbox newt.uiCheckbox.OnToggled(func(spin *ui.Checkbox) { - n.value = newt.checked() - n.doUserEvent() + n.SetValue(newt.checked()) + me.myTree.DoUserEvent(n) }) - n.tk = newt - p.place(n) + n.TK = newt + place(p, n) } func (t *guiWidget) checked() bool { -- cgit v1.2.3