summaryrefslogtreecommitdiff
path: root/find.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-10-25 05:41:12 -0500
committerJeff Carr <[email protected]>2021-10-25 05:41:12 -0500
commitc4012643faf61722e319e8126b0adc55bd67294d (patch)
tree689157c61abf7aa283421fb652c2760ef228a9f9 /find.go
parentcbb777cb3dabee7fd7a9979bf4690a4ebf593666 (diff)
CLEAN: clean up labels
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'find.go')
-rw-r--r--find.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/find.go b/find.go
new file mode 100644
index 0000000..baf1a45
--- /dev/null
+++ b/find.go
@@ -0,0 +1,35 @@
+package gui
+
+import (
+ "log"
+
+// "github.com/andlabs/ui"
+// _ "github.com/andlabs/ui/winmanifest"
+// "github.com/davecgh/go-spew/spew"
+)
+
+
+func FindWindow(s string) *GuiWindow {
+ for name, window := range Data.WindowMap {
+ if name == s {
+ return window
+ }
+ }
+ log.Printf("COULD NOT FIND WINDOW", s)
+ return nil
+}
+
+func FindBox(s string) *GuiBox {
+ for name, window := range Data.WindowMap {
+ if name != s {
+ continue
+ }
+ for name, abox := range window.BoxMap {
+ log.Printf("gui.DumpBoxes() \tBOX mapname=%-12s abox.Name=%-12s", name, abox.Name)
+ return abox
+ }
+ log.Println("gui.FindBox() NEED TO INIT WINDOW name =", name)
+ }
+ log.Println("gui.FindBox() COULD NOT FIND BOX", s)
+ return nil
+}