2022-10-21 11:40:08 -05:00
|
|
|
package gui
|
|
|
|
|
2023-03-01 11:35:36 -06:00
|
|
|
import (
|
2024-01-03 18:15:54 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
|
2024-01-05 13:18:44 -06:00
|
|
|
"go.wit.com/gui/widget"
|
2023-03-01 11:35:36 -06:00
|
|
|
)
|
2022-10-21 11:40:08 -05:00
|
|
|
|
2023-05-09 18:50:16 -05:00
|
|
|
func (parent *Node) NewTextbox(name string) *Node {
|
2024-01-05 13:18:44 -06:00
|
|
|
newNode := parent.newNode(name, widget.Textbox)
|
2024-01-13 22:02:12 -06:00
|
|
|
newNode.value = name
|
|
|
|
newNode.progname = name
|
2023-05-09 20:25:37 -05:00
|
|
|
|
|
|
|
newNode.Custom = func() {
|
2024-01-03 18:15:54 -06:00
|
|
|
log.Log(GUI, "NewTextbox changed =", name)
|
2023-05-09 20:25:37 -05:00
|
|
|
}
|
2022-10-21 11:40:08 -05:00
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
// inform the toolkits
|
|
|
|
sendAction(newNode, widget.Add)
|
2022-11-13 08:53:03 -06:00
|
|
|
return newNode
|
2022-10-21 11:40:08 -05:00
|
|
|
}
|
2023-12-14 10:36:56 -06:00
|
|
|
|
|
|
|
func (parent *Node) NewEntryLine(name string) *Node {
|
2024-01-05 13:18:44 -06:00
|
|
|
newNode := parent.newNode(name, widget.Textbox)
|
2024-01-13 22:02:12 -06:00
|
|
|
newNode.value = name
|
|
|
|
newNode.progname = name
|
2023-12-14 10:36:56 -06:00
|
|
|
|
|
|
|
newNode.X = 1
|
|
|
|
|
|
|
|
newNode.Custom = func() {
|
2024-01-03 18:15:54 -06:00
|
|
|
log.Log(GUI, "NewTextbox changed =", name)
|
2023-12-14 10:36:56 -06:00
|
|
|
}
|
|
|
|
|
2024-01-13 22:02:12 -06:00
|
|
|
// inform the toolkits
|
|
|
|
sendAction(newNode, widget.Add)
|
2023-12-14 10:36:56 -06:00
|
|
|
return newNode
|
|
|
|
}
|