summaryrefslogtreecommitdiff
path: root/button.go
blob: b083474120add2c1f21c783d204da88925dfd605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package gui

import "git.wit.org/wit/gui/toolkit"

func (n *Node) NewButton(name string, custom func()) *Node {
	newNode := n.New(name, toolkit.Button, custom)

	var a toolkit.Action
	a.Title = name
	a.Type = toolkit.Add
	a.Callback = callback
	newaction(&a, newNode, n)

	return newNode
}

func callback(i int) {
	log(debugError, "button callback() i =", i)
}