blob: f4032d0f7e76649cbd8eda5f62a1ca5530165f7e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
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)
t = andlabs[a.ParentId]
if (t == nil) {
log(debugToolkit, "newButton() toolkit struct == nil. name=", a.Name)
return
}
newt = new(andlabsT)
b = ui.NewButton(a.Text)
newt.uiButton = b
newt.uiControl = b
newt.wId = a.WidgetId
newt.WidgetType = a.WidgetType
newt.parent = t
place(a, t, newt)
b.OnClicked(func(*ui.Button) {
newt.doUserEvent()
})
}
|