new-gui/button.go

15 lines
307 B
Go
Raw Permalink Normal View History

package gui
import "go.wit.com/gui/widget"
func (parent *Node) NewButton(name string, custom func()) *Node {
newNode := parent.newNode(name, widget.Button)
newNode.Custom = custom
newNode.value = name
newNode.progname = name
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}