summaryrefslogtreecommitdiff
path: root/find.go
diff options
context:
space:
mode:
Diffstat (limited to 'find.go')
-rw-r--r--find.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/find.go b/find.go
index 1c8deb9..9191b06 100644
--- a/find.go
+++ b/find.go
@@ -58,6 +58,26 @@ func (tk *guiWidget) findByXYreal(w int, h int) []*guiWidget {
return widgets
}
+// returns all the windows from the root of the binary tree
+func findWindows() []*guiWidget {
+ rootW := me.treeRoot.TK.(*guiWidget)
+ return rootW.findWindows()
+}
+
+// walk the binary tree looking for WidgetType == Window
+func (tk *guiWidget) findWindows() []*guiWidget {
+ var found []*guiWidget
+
+ if tk.node.WidgetType == widget.Window {
+ found = append(found, tk)
+ }
+
+ for _, child := range tk.children {
+ found = append(found, child.findWindows()...)
+ }
+ return found
+}
+
func (tk *guiWidget) setFullSize() rectType {
r := tk.getFullSize()