diff options
Diffstat (limited to 'find.go')
| -rw-r--r-- | find.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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() |
