diff options
Diffstat (limited to 'dropdown.go')
| -rw-r--r-- | dropdown.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/dropdown.go b/dropdown.go index fde6a6b..48bb5d2 100644 --- a/dropdown.go +++ b/dropdown.go @@ -158,27 +158,23 @@ func (w *guiWidget) dropdownClicked(mouseW, mouseH int) string { var dtoggle bool // temporarily tracking show & hide var doffset int = 5 // how many spaces over the dropdown menu should be from the mouse -func dropdownUnclicked(mouseW, mouseH int) { +func dropdownUnclicked(w, h int) { var d *guiWidget - // log.Log(GOCUI, "dropdownUnclicked() mouseup: got inside me.dropdown handler? wxh =", mouseW, mouseH) if me.dropdownV == nil { - log.Log(GOCUI, "mouseUp() dropdownV = nil. you don't have a fake dropdown window to make visible", mouseW, mouseH) + log.Log(GOCUI, "mouseUp() dropdownV = nil") return } - // log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked at apparently (w=%d h=%d)", mouseW, mouseH)) - // log.Log(GOCUI, "dropdownUnclicked() find out what the string is here", mouseW, mouseH, tk.gocuiSize.h1) // examine everything under X & Y on the screen) - for i, w := range findByXY(mouseW, mouseH) { - log.Log(GOCUI, "dropdownUnclicked()", i, w.WidgetType) - if w.WidgetType == widget.Dropdown { - d = w - break + for _, tk := range findByXY(w, h) { + // log.Log(GOCUI, fmt.Sprintf("findByXY() (dropdown) %-8s wId=%4d at (%3d,%3d) %s", tk.WidgetType, tk.node.WidgetId, w, h, tk.node.String())) + if tk.WidgetType == widget.Dropdown { + d = tk } } if d == nil { - log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked() there was no dropdown widget at (w=%d h=%d)", mouseW, mouseH)) + // log.Log(GOCUI, fmt.Sprintf("dropdownUnclicked() there was no dropdown widget at (w=%d h=%d)", mouseW, mouseH)) return } log.Log(GOCUI, "dropdownUnclicked()", d.node.Strings(), "end. now try to enable me.dropdownV") @@ -191,7 +187,7 @@ func dropdownUnclicked(mouseW, mouseH int) { tk.SetText("goodbye") } else { log.Log(GOCUI, "dropdownUnclicked() set visible=true") - tk.MoveToOffset(mouseW+doffset, mouseH) + tk.MoveToOffset(w+doffset, h) tk.SetText(dtext) tk.Show() dtoggle = true |
