summaryrefslogtreecommitdiff
path: root/dropdown.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-31 08:50:00 -0600
committerJeff Carr <[email protected]>2025-01-31 13:47:45 -0600
commit75a5c7bf728d02bcf5accd1360c99a9c6edc0b91 (patch)
treed0c783cbeaedb2c1188951fd95fc04d1fd55d54c /dropdown.go
parent11465e4043304d40a815c49adc3d829e5ba55449 (diff)
wrapping my head around this code again
Diffstat (limited to 'dropdown.go')
-rw-r--r--dropdown.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/dropdown.go b/dropdown.go
index 24fb4c6..3674e1e 100644
--- a/dropdown.go
+++ b/dropdown.go
@@ -10,6 +10,17 @@ import (
"go.wit.com/widget"
)
+// dropdowns don't exist so this is an attempt to pretend they exist
+// by having a fake window view in gocui that appears with the dropdown
+// items. by detecting where the user clicks, we should be
+// able to set the text of the button to that value (and
+// rezise it.
+
+// the thing is this is so damned complicated because it
+// is very hard to debug this. thanks to the floating on
+// screen debugging output I might be able to figure it
+// it out now. maybe. notsure.
+
func makeDropdownView(ddItems string) *guiWidget {
newNode := addDropdown()
tk := newNode.TK.(*guiWidget)
@@ -145,12 +156,12 @@ 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)
if me.dropdownV == nil {
log.Log(GOCUI, "mouseUp() dropdownV = nil", mouseX, mouseH)
return
}
tk := me.dropdownV
- log.Log(GOCUI, "mouseUp() view msgMouseDown (check here for dropdown menu click) (w,h) =", mouseX, mouseH)
- log.Log(GOCUI, "mouseUp() ddview is the thing that was clicked", mouseX, mouseH)
- log.Log(GOCUI, "mouseUp() 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)
}