summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/textbox.go
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/andlabs/textbox.go')
-rw-r--r--toolkit/andlabs/textbox.go38
1 files changed, 8 insertions, 30 deletions
diff --git a/toolkit/andlabs/textbox.go b/toolkit/andlabs/textbox.go
index 626eec4..5dca1bc 100644
--- a/toolkit/andlabs/textbox.go
+++ b/toolkit/andlabs/textbox.go
@@ -1,43 +1,21 @@
package main
import (
- "git.wit.org/wit/gui/toolkit"
-
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
)
-// func newTextbox(a *toolkit.Action) {
-func (t *andlabsT) newTextbox() *andlabsT {
- var newt andlabsT
-
- c := ui.NewNonWrappingMultilineEntry()
- newt.uiMultilineEntry = c
- newt.uiControl = c
+func (p *node) newTextbox(n *node) {
+ newt := new(andlabsT)
- newt.WidgetType = toolkit.Textbox
+ e := ui.NewNonWrappingMultilineEntry()
+ newt.uiMultilineEntry = e
+ newt.uiControl = e
- c.OnChanged(func(spin *ui.MultilineEntry) {
- newt.s = spin.Text()
- // this is still dangerous
- log(debugChange, "Not yet safe to trigger on change for ui.MultilineEntry")
+ e.OnChanged(func(spin *ui.MultilineEntry) {
newt.s = spin.Text()
newt.doUserEvent()
})
- return &newt
-}
-
-func newTextbox(a *toolkit.Action) {
- log(debugToolkit, "newCombobox()", a.Name)
-
- t := andlabs[a.ParentId]
- if (t == nil) {
- log(debugToolkit, "newCombobox() toolkit struct == nil. name=", a.Name)
- listMap(debugToolkit)
- return
- }
- newt := t.newTextbox()
- newt.Name = a.Name
- newt.wId = a.WidgetId
- place(a, t, newt)
+ n.tk = newt
+ p.place(n)
}