summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dropdown.go19
1 files changed, 15 insertions, 4 deletions
diff --git a/dropdown.go b/dropdown.go
index b054d8d..de72b41 100644
--- a/dropdown.go
+++ b/dropdown.go
@@ -155,6 +155,8 @@ func (w *guiWidget) dropdownClicked(mouseW, mouseH int) string {
return ""
}
+var dtoggle bool
+
func dropdownUnclicked(mouseX, mouseH int) {
var d *guiWidget
@@ -163,9 +165,8 @@ func dropdownUnclicked(mouseX, mouseH int) {
log.Log(GOCUI, "mouseUp() dropdownV = nil. you don't have a fake dropdown window to make visible", mouseX, mouseH)
return
}
- tk := me.dropdownV
- log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked at apparently (w=%d h=%d)", mouseX, mouseH))
- log.Log(GOCUI, "dropdownUnclicked() find out what the string is here", mouseX, mouseH, tk.gocuiSize.h1)
+ // log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked at apparently (w=%d h=%d)", mouseX, mouseH))
+ // log.Log(GOCUI, "dropdownUnclicked() find out what the string is here", mouseX, mouseH, tk.gocuiSize.h1)
rootW := me.treeRoot.TK.(*guiWidget)
// examine everything under X & Y on the screen)
@@ -180,5 +181,15 @@ func dropdownUnclicked(mouseX, mouseH int) {
log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked() there was no dropdown widget at (w=%d h=%d)", mouseX, mouseH))
return
}
- log.Log(GOCUI, "dropdownUnclicked()", d.node.Strings(), "end")
+ log.Log(GOCUI, "dropdownUnclicked()", d.node.Strings(), "end. now try to enable me.dropdownV")
+ tk := me.dropdownV
+ if dtoggle {
+ log.Log(GOCUI, "dropdownUnclicked() set visible=false")
+ tk.Hide()
+ dtoggle = false
+ } else {
+ log.Log(GOCUI, "dropdownUnclicked() set visible=true")
+ tk.Show()
+ dtoggle = true
+ }
}