toggle on the me.dropdown widget works
This commit is contained in:
parent
1d32c5da2b
commit
4aef276b64
19
dropdown.go
19
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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue