diff options
| author | Jeff Carr <[email protected]> | 2025-01-31 09:49:27 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-31 13:47:45 -0600 |
| commit | 1d32c5da2b184314758726ecdfbcd6dbb548c867 (patch) | |
| tree | 6b1ca2b83e52a2d83a51e83df2ba4451e78662ec /dropdown.go | |
| parent | 9f38585892d08690dde1b67b9a01006af308a949 (diff) | |
got the strings for a dropdown widget (finally. only took me 4 years)
Diffstat (limited to 'dropdown.go')
| -rw-r--r-- | dropdown.go | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/dropdown.go b/dropdown.go index 3674e1e..b054d8d 100644 --- a/dropdown.go +++ b/dropdown.go @@ -156,12 +156,29 @@ func (w *guiWidget) dropdownClicked(mouseW, mouseH int) string { } func dropdownUnclicked(mouseX, mouseH int) { - log.Log(GOCUI, "dropdownUnclicked() mouseup: got inside me.dropdown handler? wxh =", mouseX, mouseH) + var d *guiWidget + + // log.Log(GOCUI, "dropdownUnclicked() mouseup: got inside me.dropdown handler? wxh =", mouseX, mouseH) if me.dropdownV == nil { - log.Log(GOCUI, "mouseUp() dropdownV = nil", mouseX, mouseH) + 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) + + rootW := me.treeRoot.TK.(*guiWidget) + // examine everything under X & Y on the screen) + for i, w := range findByXY(rootW, mouseX, mouseH) { + log.Log(GOCUI, "dropdownUnclicked()", i, w.WidgetType) + if w.WidgetType == widget.Dropdown { + d = w + break + } + } + if d == nil { + 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") } |
