summaryrefslogtreecommitdiff
path: root/new-structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-10-07 05:52:22 -0500
committerJeff Carr <[email protected]>2021-10-07 05:52:22 -0500
commit3eac6beec4c3809b4696d63a252a34a6c6dc8ae1 (patch)
tree9b5e5046a59607482418a44c3e6e128cb33a9ebe /new-structs.go
parent44b56de98421262ca10c741737faafe056470255 (diff)
NODE: start passing *Node around
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'new-structs.go')
-rw-r--r--new-structs.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/new-structs.go b/new-structs.go
index 0fa326a..df25cae 100644
--- a/new-structs.go
+++ b/new-structs.go
@@ -15,13 +15,20 @@ type Node struct {
Width int
Height int
- uiType *ui.Control
children []*Node
+
+ control *ui.Control
+ window *ui.Window
}
func (n Node) SetName(name string) {
// n.uiType.SetName(name)
- log.Println("n.uiType =", n.uiType)
+ if (n.window != nil) {
+ log.Println("node is a window. setting title =", name)
+ n.window.SetTitle(name)
+ return
+ }
+ log.Println("*ui.Control =", n.control)
return
}