summaryrefslogtreecommitdiff
path: root/andlabs/textbox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-01 16:11:54 -0600
committerJeff Carr <[email protected]>2024-01-01 16:11:54 -0600
commit36218f4535dd65d2c8d4ecbea761b3b0289e6f3c (patch)
tree24cf9c64dd518528f30a6282e879e8e5c6136bd4 /andlabs/textbox.go
move into seperate repo
Diffstat (limited to 'andlabs/textbox.go')
-rw-r--r--andlabs/textbox.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/andlabs/textbox.go b/andlabs/textbox.go
new file mode 100644
index 0000000..7cb5d63
--- /dev/null
+++ b/andlabs/textbox.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "github.com/andlabs/ui"
+ _ "github.com/andlabs/ui/winmanifest"
+)
+
+func (p *node) newTextbox(n *node) {
+ newt := new(guiWidget)
+
+ if (n.X == 1) {
+ e := ui.NewEntry()
+ newt.uiEntry = e
+ newt.uiControl = e
+
+ e.OnChanged(func(spin *ui.Entry) {
+ n.S = spin.Text()
+ n.doUserEvent()
+ })
+ } else {
+ e := ui.NewNonWrappingMultilineEntry()
+ newt.uiMultilineEntry = e
+ newt.uiControl = e
+
+ e.OnChanged(func(spin *ui.MultilineEntry) {
+ n.S = spin.Text()
+ n.doUserEvent()
+ })
+ }
+ n.tk = newt
+ p.place(n)
+}