summaryrefslogtreecommitdiff
path: root/andlabs/button.go
blob: 81a30c00ee6bebc477a05d0baa86310f17935e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"go.wit.com/dev/andlabs/ui"
	_ "go.wit.com/dev/andlabs/ui/winmanifest"
)

func (p *node) newButton(n *node) {
	t := p.tk
	newt := new(guiWidget)

	b := ui.NewButton(getString(n.value))
	newt.uiButton = b
	newt.uiControl = b
	newt.parent = t

	b.OnClicked(func(*ui.Button) {
		n.doUserEvent()
	})

	n.tk = newt
	p.place(n)
}