summaryrefslogtreecommitdiff
path: root/dropdown.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-06 23:49:18 -0600
committerJeff Carr <[email protected]>2025-02-06 23:49:18 -0600
commitc2f8cac4a9f9737eee5983ca7ce81fde8c102715 (patch)
treee33ca8bb88def7e0f9d4b1946c3f59a30cc0e049 /dropdown.go
parent7e47ca98435ed6315f2f0c15d41a1c817576f0f3 (diff)
basic start of a stubbed out 'textbox' entry box
Diffstat (limited to 'dropdown.go')
-rw-r--r--dropdown.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/dropdown.go b/dropdown.go
index f426fc0..f14e54b 100644
--- a/dropdown.go
+++ b/dropdown.go
@@ -23,6 +23,7 @@ import (
// 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)
@@ -47,6 +48,7 @@ func makeDropdownView(ddItems string) *guiWidget {
tk.Show()
return tk
}
+*/
func addDropdownTK(wId int) *guiWidget {
n := addDropdownNew(wId)
@@ -99,7 +101,7 @@ func (tk *guiWidget) showDropdown() {
log.Log(GOCUI, "new dropdown items should be set to:", me.dropdown.items)
if me.dropdown.tk == nil {
- me.dropdown.tk = addDropdownTK(-77)
+ me.dropdown.tk = addDropdownTK(me.dropdown.wId)
}
if me.dropdown.tk == nil {
log.Log(GOCUI, "showDropdown() IS BROKEN")
@@ -159,3 +161,22 @@ func dropdownUnclicked(w, h int) {
}
// log.Log(GOCUI, "dropdownUnclicked()", d.node.Strings(), "end. now try to enable me.dropdownV")
}
+
+func (tk *guiWidget) showTextbox() {
+ // todo: fix this after switching to protobuf
+
+ if me.textbox.tk == nil {
+ me.textbox.tk = addDropdownTK(me.textbox.wId)
+ }
+ if me.textbox.tk == nil {
+ log.Log(GOCUI, "showDropdown() IS BROKEN")
+ return
+ }
+ startW, startH := tk.Position()
+ log.Log(GOCUI, "showDropdown() SHOWING AT W,H=", startW, startH)
+ me.textbox.tk.MoveToOffset(startW+3, startH+2)
+ me.textbox.tk.labelN = "holy cow"
+ me.textbox.tk.Show()
+ me.textbox.active = true
+ me.textbox.callerTK = tk
+}