summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/button.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-27 09:59:19 -0500
committerJeff Carr <[email protected]>2023-04-27 09:59:19 -0500
commit6e52d306bf6fe15d00108b305b497a9722f491ca (patch)
treefea0f4ea1dcfde8442fab2450a681638d7f5663a /toolkit/andlabs/button.go
parenta0d0a93f7f7131f6ef50ebbe4bad9a57f2e1245d (diff)
andlabs: button in binary tree
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/button.go')
-rw-r--r--toolkit/andlabs/button.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/toolkit/andlabs/button.go b/toolkit/andlabs/button.go
index f4032d0..b3eae7b 100644
--- a/toolkit/andlabs/button.go
+++ b/toolkit/andlabs/button.go
@@ -3,34 +3,30 @@ package main
import (
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
-
- "git.wit.org/wit/gui/toolkit"
)
-func newButton(a *toolkit.Action) {
- var t, newt *andlabsT
- var b *ui.Button
- log(debugToolkit, "newButton()", a.Name)
+func (p *node) newButton(n *node) {
+ log(debugToolkit, "newButton()", n.Name)
- t = andlabs[a.ParentId]
+ t := p.tk
if (t == nil) {
- log(debugToolkit, "newButton() toolkit struct == nil. name=", a.Name)
+ log(debugToolkit, "newButton() toolkit struct == nil. name=", n.Name)
return
}
- newt = new(andlabsT)
+ newt := new(andlabsT)
- b = ui.NewButton(a.Text)
+ b := ui.NewButton(n.Text)
newt.uiButton = b
newt.uiControl = b
- newt.wId = a.WidgetId
- newt.WidgetType = a.WidgetType
+ newt.wId = n.WidgetId
+ newt.WidgetType = n.WidgetType
newt.parent = t
- place(a, t, newt)
-
b.OnClicked(func(*ui.Button) {
newt.doUserEvent()
})
+ n.tk = newt
+ p.place(n)
}