summaryrefslogtreecommitdiff
path: root/gadgets/oneLiner.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-01 15:43:50 -0600
committerJeff Carr <[email protected]>2024-01-01 15:43:50 -0600
commit4e7bbd89900a733593f0848778103c1cf1a7145d (patch)
tree22cd22124dd3ecba7c2a866b882d39aaf790d670 /gadgets/oneLiner.go
parent53ce3a8252090d5fb75d7fc1e3cd75a72c1415c6 (diff)
reorg to final resting place at go.wit.com/gui/guiv0.9.5
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gadgets/oneLiner.go')
-rw-r--r--gadgets/oneLiner.go56
1 files changed, 0 insertions, 56 deletions
diff --git a/gadgets/oneLiner.go b/gadgets/oneLiner.go
deleted file mode 100644
index 529cec3..0000000
--- a/gadgets/oneLiner.go
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- A Labeled label:
-
- -----------------------------
- | | |
- | Food: | Apple |
- | | |
- -----------------------------
-*/
-package gadgets
-
-import (
- "go.wit.com/log"
- "go.wit.com/gui"
-)
-
-type OneLiner struct {
- p *gui.Node // parent widget
- l *gui.Node // label widget
- v *gui.Node // value widget
-
- value string
- label string
-
- Custom func()
-}
-
-func (n *OneLiner) Get() string {
- return n.value
-}
-
-func (n *OneLiner) Set(value string) *OneLiner {
- log.Println("OneLiner.Set() =", value)
- if (n.v != nil) {
- n.v.Set(value)
- }
- n.value = value
- return n
-}
-
-func NewOneLiner(n *gui.Node, name string) *OneLiner {
- d := OneLiner {
- p: n,
- value: "",
- }
-
- // various timeout settings
- d.l = n.NewLabel(name)
- d.v = n.NewLabel("")
- d.v.Custom = func() {
- d.value = d.v.S
- log.Println("OneLiner.Custom() user changed value to =", d.value)
- }
-
- return &d
-}