toggle on the me.dropdown widget works

This commit is contained in:
Jeff Carr 2025-01-31 10:03:56 -06:00
parent 1d32c5da2b
commit 4aef276b64
1 changed files with 15 additions and 4 deletions

View File

@ -155,6 +155,8 @@ func (w *guiWidget) dropdownClicked(mouseW, mouseH int) string {
return "" return ""
} }
var dtoggle bool
func dropdownUnclicked(mouseX, mouseH int) { func dropdownUnclicked(mouseX, mouseH int) {
var d *guiWidget 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) log.Log(GOCUI, "mouseUp() dropdownV = nil. you don't have a fake dropdown window to make visible", mouseX, mouseH)
return return
} }
tk := me.dropdownV // log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked at apparently (w=%d h=%d)", mouseX, mouseH))
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, "dropdownUnclicked() find out what the string is here", mouseX, mouseH, tk.gocuiSize.h1)
rootW := me.treeRoot.TK.(*guiWidget) rootW := me.treeRoot.TK.(*guiWidget)
// examine everything under X & Y on the screen) // 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)) log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked() there was no dropdown widget at (w=%d h=%d)", mouseX, mouseH))
return 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
}
} }