summaryrefslogtreecommitdiff
path: root/addText.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-18 00:43:48 -0600
committerJeff Carr <[email protected]>2024-01-18 00:43:48 -0600
commitaff82aa4ea8f9e7dcc549afec9218154e1d9c7bd (patch)
tree1ef64a2a6806a6f3bbcf9e0fc8715fd824e9d53a /addText.go
parentd048182ab8e2b3e35aacffce7306583f5caae3aa (diff)
new pathsv0.12.14
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'addText.go')
-rw-r--r--addText.go32
1 files changed, 18 insertions, 14 deletions
diff --git a/addText.go b/addText.go
index 7f98c63..4187115 100644
--- a/addText.go
+++ b/addText.go
@@ -1,15 +1,17 @@
package gui
import (
+ "go.wit.com/lib/widget"
"go.wit.com/log"
- "go.wit.com/gui/widget"
)
// tracks dropdown and combobox entries. Makes sure they are unique
func (n *Node) addText(newS string) {
var highest int
for s, i := range n.strings {
- if i > highest { highest = i }
+ if i > highest {
+ highest = i
+ }
if s == newS {
return
}
@@ -17,17 +19,17 @@ func (n *Node) addText(newS string) {
n.strings[newS] = highest + 1 // TODO: use the int's for the order
n.value = newS
/*
- // time.Sleep(time.Duration(1000 * time.Nanosecond)) // doesn't work
- // maybe this stupid chipset is defective. TODO: try on different hardware
- // tried with go 1.21.4 debian sid
- mylock.Lock()
- n.mu.Lock()
- // time.Sleep(time.Duration(10 * time.Microsecond)) // doesn't work
- time.Sleep(time.Duration(100 * time.Microsecond)) // does work
- n.strings = append(n.strings, newS)
- n.mu.Unlock()
- mylock.Unlock()
- log.Warn("addText() has strings:", n.strings)
+ // time.Sleep(time.Duration(1000 * time.Nanosecond)) // doesn't work
+ // maybe this stupid chipset is defective. TODO: try on different hardware
+ // tried with go 1.21.4 debian sid
+ mylock.Lock()
+ n.mu.Lock()
+ // time.Sleep(time.Duration(10 * time.Microsecond)) // doesn't work
+ time.Sleep(time.Duration(100 * time.Microsecond)) // does work
+ n.strings = append(n.strings, newS)
+ n.mu.Unlock()
+ mylock.Unlock()
+ log.Warn("addText() has strings:", n.strings)
*/
// inform the toolkits
@@ -38,7 +40,9 @@ func (n *Node) addText(newS string) {
// multiple string values
// These must be unique. return false if the string already exists
func (n *Node) AddText(str string) bool {
- if ! n.Ready() { return false }
+ if !n.Ready() {
+ return false
+ }
log.Warn("AddText() value =", str)
log.Warn("AddText() value =", str)
log.Warn("AddText() value =", str)