From 49202eeafdad8e5780fefdad3d2f87fd4354725e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 3 Mar 2023 14:41:38 -0600 Subject: release as v0.6.5 good standard release really clean interaction to plugin really clean debug flags implementation common doAppend() idea, but it probably won't work re-implement combobox. this code base almost doesn't suck slider & spinner set values now tab set margin works convert dropdown to Send() lots of other changes to try to implement single line Entry() I guess use golang file names even though internalally the go developers use underscore chars in the actual go sources. Maybe there is a reason for that? go channel debug window does something make a debug window for channels. add sample icons Signed-off-by: Jeff Carr --- common.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'common.go') diff --git a/common.go b/common.go index 22e4319..1518bc8 100644 --- a/common.go +++ b/common.go @@ -8,6 +8,13 @@ import ( // functions for handling text related GUI elements +func (n *Node) Add(str string) { + log(debugGui, "gui.Add() value =", str) + n.widget.Action = "Add" + n.widget.S = str + send(n.parent, n) +} + func (n *Node) SetText(str string) bool { log(debugChange, "gui.SetText() value =", str) n.widget.Action = "Set" @@ -16,6 +23,23 @@ func (n *Node) SetText(str string) bool { return true } +func (n *Node) Set(a any) bool { + log(debugChange, "gui.Set() value =", a) + n.widget.Action = "Set" + switch v := a.(type) { + case bool: + n.widget.B = a.(bool) + case string: + n.widget.S = a.(string) + case int: + n.widget.I = a.(int) + default: + log(debugError, "gui.Set() unknown type =", v, "a =", a) + } + send(n.parent, n) + return true +} + func (n *Node) AppendText(str string) bool { n.widget.Action = "Set" tmp := n.widget.S + str -- cgit v1.2.3