new-gui/textbox.go

38 lines
688 B
Go
Raw Normal View History

package gui
import (
"go.wit.com/log"
"go.wit.com/gui/widget"
)
func (parent *Node) NewTextbox(name string) *Node {
newNode := parent.newNode(name, widget.Textbox)
newNode.value = name
newNode.progname = name
newNode.Custom = func() {
log.Log(GUI, "NewTextbox changed =", name)
}
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}
func (parent *Node) NewEntryLine(name string) *Node {
newNode := parent.newNode(name, widget.Textbox)
newNode.value = name
newNode.progname = name
newNode.X = 1
newNode.Custom = func() {
log.Log(GUI, "NewTextbox changed =", name)
}
// inform the toolkits
sendAction(newNode, widget.Add)
return newNode
}