diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 21:31:49 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 21:31:49 -0600 |
| commit | 841e6252c95244f0ee7faf2c01d33f69a8ab483a (patch) | |
| tree | ef400228622b87611168db2227269ba7fd56625d /andlabs/textbox.go | |
| parent | ba95c13799740b5f55541fc5e8ab9f1d34f7e421 (diff) | |
common tree package for toolkitsv0.12.4
This update provides *lots* of toolkit updates. This will allow
the next step of debugging the gocui toolkit to make it work
again. There are new common routines for handling the plugin
channel communication
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'andlabs/textbox.go')
| -rw-r--r-- | andlabs/textbox.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/andlabs/textbox.go b/andlabs/textbox.go index 30671cd..3748a14 100644 --- a/andlabs/textbox.go +++ b/andlabs/textbox.go @@ -1,21 +1,24 @@ package main import ( + "go.wit.com/gui/toolkits/tree" + "go.wit.com/dev/andlabs/ui" _ "go.wit.com/dev/andlabs/ui/winmanifest" ) -func (p *node) newTextbox(n *node) { +func newTextbox(p, n *tree.Node) { + if notNew(n) { return } newt := new(guiWidget) - if (n.X == 1) { + if (n.State.Range.Low == 1) { e := ui.NewEntry() newt.uiEntry = e newt.uiControl = e e.OnChanged(func(spin *ui.Entry) { - n.value = spin.Text() - n.doUserEvent() + n.SetValue(spin.Text()) + me.myTree.DoUserEvent(n) }) } else { e := ui.NewNonWrappingMultilineEntry() @@ -23,10 +26,10 @@ func (p *node) newTextbox(n *node) { newt.uiControl = e e.OnChanged(func(spin *ui.MultilineEntry) { - n.value = spin.Text() - n.doUserEvent() + n.SetValue(spin.Text()) + me.myTree.DoUserEvent(n) }) } - n.tk = newt - p.place(n) + n.TK = newt + place(p, n) } |
