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/button.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'andlabs/button.go') diff --git a/andlabs/button.go b/andlabs/button.go index 0cc4f52..4bbc8f2 100644 --- a/andlabs/button.go +++ b/andlabs/button.go @@ -1,25 +1,28 @@ package main import ( - "go.wit.com/gui/widget" + "go.wit.com/gui/toolkits/tree" "go.wit.com/dev/andlabs/ui" _ "go.wit.com/dev/andlabs/ui/winmanifest" ) -func (p *node) newButton(n *node) { - t := p.tk +// func (p *node) newButton(n *node) { +func newButton(p *tree.Node, n *tree.Node) { + if notNew(n) { return } + var ptk *guiWidget + ptk = p.TK.(*guiWidget) newt := new(guiWidget) - b := ui.NewButton(widget.GetString(n.value)) + b := ui.NewButton(n.GetLabel()) newt.uiButton = b newt.uiControl = b - newt.parent = t + newt.parent = ptk b.OnClicked(func(*ui.Button) { - n.doUserEvent() + me.myTree.DoUserEvent(n) }) - n.tk = newt - p.place(n) + n.TK = newt + place(p, n) } -- cgit v1.2.3