summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-01 15:57:29 -0600
committerJeff Carr <[email protected]>2025-02-01 15:57:29 -0600
commit2e0465e44a7db03f804b6c66699f8eed3d9fbfad (patch)
tree109410f93d25c9f6ce15072adda0a1a9dfde49ff
parent49f8e1c043ed5dfe39d0c56a9fd52b20fb069bb2 (diff)
silence all dropdown menu output
-rw-r--r--dropdown.go18
-rw-r--r--eventMouseClick.go9
2 files changed, 15 insertions, 12 deletions
diff --git a/dropdown.go b/dropdown.go
index 928ae7d..0d61b74 100644
--- a/dropdown.go
+++ b/dropdown.go
@@ -134,22 +134,24 @@ func showDDview() error {
func (w *guiWidget) dropdownClicked(mouseW, mouseH int) string {
w.Hide()
- startW, startH := w.Position()
- log.Log(GOCUI, "dropdownClicked() start (w,h) =", startW, startH)
- log.Log(GOCUI, "dropdownClicked() at (w,h) =", mouseW, mouseH)
+ // only need height to figure out what line in the dropdown menu the user clicked
+ _, startH := w.Position()
+ // startW, startH := w.Position()
+ // log.Log(GOCUI, "dropdownClicked() start (w,h) =", startW, startH)
+ // log.Log(GOCUI, "dropdownClicked() at (w,h) =", mouseW, mouseH)
itemNumber := mouseH - startH
items := strings.Split(w.labelN, "\n")
- log.Log(GOCUI, "dropdownClicked() look for item", itemNumber, "len(items) =", len(items))
+ // log.Log(GOCUI, "dropdownClicked() look for item", itemNumber, "len(items) =", len(items))
if itemNumber < 1 {
return ""
}
if len(items) >= itemNumber {
- log.Log(GOCUI, "dropdownClicked() found", items[itemNumber-1])
+ // log.Log(GOCUI, "dropdownClicked() found", items[itemNumber-1])
if items[itemNumber-1] != "" {
if me.dropdownW != nil {
- log.Log(GOCUI, "dropdownClicked() send event for", me.dropdownW.cuiName, me.dropdownW.node.WidgetType)
+ // log.Log(GOCUI, "dropdownClicked() send event for", me.dropdownW.cuiName, me.dropdownW.node.WidgetType)
me.dropdownW.SetText(items[itemNumber-1])
me.dropdownW.node.SetCurrentS(items[itemNumber-1])
me.myTree.SendUserEvent(me.dropdownW.node)
@@ -186,12 +188,12 @@ func dropdownUnclicked(w, h int) {
dtext := strings.Join(d.node.Strings(), "\n")
tk := me.dropdownV
if dtoggle {
- log.Log(GOCUI, "dropdownUnclicked() set visible=false")
+ // log.Log(GOCUI, "dropdownUnclicked() set visible=false")
tk.Hide()
dtoggle = false
tk.SetText("goodbye")
} else {
- log.Log(GOCUI, "dropdownUnclicked() set visible=true")
+ // log.Log(GOCUI, "dropdownUnclicked() set visible=true")
tk.MoveToOffset(w+doffset, h)
tk.SetText(dtext)
tk.Show()
diff --git a/eventMouseClick.go b/eventMouseClick.go
index c3c960e..d473a46 100644
--- a/eventMouseClick.go
+++ b/eventMouseClick.go
@@ -79,16 +79,17 @@ func (tk *guiWidget) doWidgetClick(w int, h int) {
tk.showDropdown()
me.dropdownW = tk
case widget.Dropdown:
- log.Log(GOCUI, "do the dropdown here")
+ // log.Log(GOCUI, "do the dropdown here")
tk.showDropdown()
me.dropdownW = tk
case widget.Stdout:
log.Log(GOCUI, "stdout widget found!")
tk.dumpWidget("stdout click")
case widget.Flag:
- log.Log(GOCUI, "flag widget found!")
- got := tk.dropdownClicked(w, h)
- log.Log(GOCUI, "flag click got", got)
+ // log.Log(GOCUI, "flag widget found!")
+ tk.dropdownClicked(w, h)
+ // got_ := dropdownClicked(w, h)
+ // log.Log(GOCUI, "flag click got", got)
default:
tk.dumpWidget("blank click()")
}