summaryrefslogtreecommitdiff
path: root/linuxstatus/common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-06 11:12:10 -0600
committerJeff Carr <[email protected]>2024-01-06 11:12:10 -0600
commitf6f5bdba4e982595ad1c12041d39f75e11792ef8 (patch)
tree89c5c4856fcec28bb28fe0be4a4706559b6a3979 /linuxstatus/common.go
parentc59247824f22cf62b1625f5eeea11b809374d7a0 (diff)
stepping through init on a window with state
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'linuxstatus/common.go')
-rw-r--r--linuxstatus/common.go40
1 files changed, 38 insertions, 2 deletions
diff --git a/linuxstatus/common.go b/linuxstatus/common.go
index 8bedaf8..b568146 100644
--- a/linuxstatus/common.go
+++ b/linuxstatus/common.go
@@ -3,30 +3,52 @@ package linuxstatus
import (
"go.wit.com/log"
+ "go.wit.com/gui/gui"
)
+func (ls *LinuxStatus) Draw() {
+ log.Log(CHANGE, "linuxStatus.Draw() window")
+ if ! ls.Ready() {return}
+ log.Log(CHANGE, "linuxStatus.Draw() window ready =", ls.ready)
+ ls.window.Draw()
+ ls.ready = true
+}
+func (ls *LinuxStatus) Draw2() {
+ log.Log(CHANGE, "draw(ls)")
+ if ! ls.Ready() {return}
+ log.Log(CHANGE, "draw(ls) ready =", ls.ready)
+ draw(ls)
+}
+
func (ls *LinuxStatus) Show() {
log.Log(CHANGE, "linuxStatus.Show() window")
+ if ! ls.Ready() {return}
+ log.Log(CHANGE, "linuxStatus.Show() window ready =", ls.ready)
ls.window.Show()
ls.hidden = false
}
func (ls *LinuxStatus) Hide() {
log.Log(CHANGE, "linuxStatus.Hide() window")
+ if ! ls.Ready() {return}
+ log.Log(CHANGE, "linuxStatus.Hide() window ready =", ls.ready)
ls.window.Hide()
ls.hidden = true
}
func (ls *LinuxStatus) Toggle() {
log.Log(CHANGE, "linuxStatus.Toggle() window")
+ if ! ls.Ready() {return}
+ log.Log(CHANGE, "linuxStatus.Toggle() window ready =", ls.ready)
if ls.hidden {
- ls.window.Show()
+ ls.Show()
} else {
- ls.window.Hide()
+ ls.Hide()
}
}
func (ls *LinuxStatus) Ready() bool {
+ log.Log(CHANGE, "Ready() ls =", ls)
if me == nil {return false}
if ls == nil {return false}
if ls.window == nil {return false}
@@ -34,8 +56,22 @@ func (ls *LinuxStatus) Ready() bool {
}
func (ls *LinuxStatus) Initialized() bool {
+ log.Log(CHANGE, "checking Initialized() ls =", ls)
if me == nil {return false}
if ls == nil {return false}
if ls.parent == nil {return false}
return true
}
+
+func (ls *LinuxStatus) SetParent(p *gui.Node) {
+ log.Log(CHANGE, "Attempting SetParent =", p)
+ if me == nil {return}
+ if ls == nil {return}
+ if ls.parent == nil {
+ log.Log(CHANGE, "SetParent =", p)
+ ls.parent = p
+ return
+ } else {
+ log.Log(CHANGE, "SetParent was already set to =", ls.parent)
+ }
+}