diff options
| author | Jeff Carr <[email protected]> | 2024-01-01 15:43:50 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-01 15:43:50 -0600 |
| commit | 4e7bbd89900a733593f0848778103c1cf1a7145d (patch) | |
| tree | 22cd22124dd3ecba7c2a866b882d39aaf790d670 /gadgets/basicLabel.go | |
| parent | 53ce3a8252090d5fb75d7fc1e3cd75a72c1415c6 (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/basicLabel.go')
| -rw-r--r-- | gadgets/basicLabel.go | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/gadgets/basicLabel.go b/gadgets/basicLabel.go deleted file mode 100644 index a952912..0000000 --- a/gadgets/basicLabel.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - A Labeled label: - - ----------------------------- - | | | - | Food: | Apple | - | | | - ----------------------------- -*/ -package gadgets - -import ( - "go.wit.com/log" - "go.wit.com/gui" -) - -type Node gui.Node - -type BasicLabel struct { - p *gui.Node // parent widget - l *gui.Node // label widget - v *gui.Node // value widget - - value string - label string - - Custom func() -} - -func (n *BasicLabel) Get() string { - return n.value -} - -func (n *BasicLabel) Set(value string) *BasicLabel { - log.Println("BasicLabel.Set() =", value) - if (n.v != nil) { - n.v.Set(value) - } - n.value = value - return n -} - -func (ngui *Node) NewBasicLabel(name string) *BasicLabel { - var n *gui.Node - n = (*gui.Node)(ngui) - d := BasicLabel { - 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("BasicLabel.Custom() user changed value to =", d.value) - } - - return &d -} |
