summaryrefslogtreecommitdiff
path: root/toolkit/andlabs/textbox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-21 11:40:08 -0500
committerJeff Carr <[email protected]>2022-10-21 11:40:08 -0500
commita3fc02c2f7e22f92b76ff6db92618be0cf3656a6 (patch)
tree70c05aada2b3acfbb95d1e6e0098291c7f8b6bcf /toolkit/andlabs/textbox.go
parentb8ef0bb05dc14bc4291f3d156b199fa125cdb9d7 (diff)
v0.4.1 set sane toolkit default look and feelv0.4.1
autogenerate README.md from doc.go (goreadme cmd) remove passing arguements on a mouse click() make defaults for padding, margin, stretchy, etc add a checkbox widget function rename to NewButton() keep cleaning up toolkit code fix date. I was somehow in the future Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/textbox.go')
-rw-r--r--toolkit/andlabs/textbox.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/toolkit/andlabs/textbox.go b/toolkit/andlabs/textbox.go
new file mode 100644
index 0000000..95bfbaa
--- /dev/null
+++ b/toolkit/andlabs/textbox.go
@@ -0,0 +1,32 @@
+package toolkit
+
+import "log"
+
+import "github.com/andlabs/ui"
+import _ "github.com/andlabs/ui/winmanifest"
+
+func (t Toolkit) NewTextbox(name string) *Toolkit {
+ log.Println("gui.Toolkit.NewTextbox()", name)
+ var newt Toolkit
+
+ if t.broken() {
+ return nil
+ }
+
+ c := ui.NewNonWrappingMultilineEntry()
+ newt.uiMultilineEntry = c
+
+ newt.uiBox = t.uiBox
+ newt.Name = name
+ if (defaultBehavior) {
+ t.uiBox.Append(c, true)
+ } else {
+ t.uiBox.Append(c, stretchy)
+ }
+
+ c.OnChanged(func(spin *ui.MultilineEntry) {
+ newt.commonChange("Textbox")
+ })
+
+ return &newt
+}