summaryrefslogtreecommitdiff
path: root/textbox.go
blob: f4b156a1e764f56d412fdb67aa1f2d831ede8b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package gui

import (
	"go.wit.com/log"

	"go.wit.com/gui/gui/toolkit"
)

func (parent *Node) NewTextbox(name string) *Node {
	newNode := parent.newNode(name, toolkit.Textbox)

	newNode.Custom = func() {
		log.Log(GUI, "NewTextbox changed =", name)
	}

	a := newAction(newNode, toolkit.Add)
	sendAction(a)
	return newNode
}

func (parent *Node) NewEntryLine(name string) *Node {
	newNode := parent.newNode(name, toolkit.Textbox)

	newNode.X = 1

	newNode.Custom = func() {
		log.Log(GUI, "NewTextbox changed =", name)
	}

	a := newAction(newNode, toolkit.Add)
	sendAction(a)
	return newNode
}