summaryrefslogtreecommitdiff
path: root/linuxstatus/new.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-06 05:55:51 -0600
committerJeff Carr <[email protected]>2024-01-06 05:55:51 -0600
commitc59247824f22cf62b1625f5eeea11b809374d7a0 (patch)
tree4aa43e92ae656d62c5b3d928768dcd7965219652 /linuxstatus/new.go
parent1de593fd63d075b58e97ff9a656acef99938e487 (diff)
more window handling
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'linuxstatus/new.go')
-rw-r--r--linuxstatus/new.go24
1 files changed, 22 insertions, 2 deletions
diff --git a/linuxstatus/new.go b/linuxstatus/new.go
index 0ce504c..5788ee1 100644
--- a/linuxstatus/new.go
+++ b/linuxstatus/new.go
@@ -2,16 +2,36 @@
package linuxstatus
import (
+ "go.wit.com/log"
+
+ "go.wit.com/gui/gadgets"
)
func New() *LinuxStatus {
+ if me != nil {
+ log.Warn("You have done New() twice. You can only do this once")
+ return me
+ }
me = &LinuxStatus {
hidden: true,
ready: false,
}
- me.init = true
return me
+}
+
+func (ls *LinuxStatus) InitWindow() {
+ if ! ls.Initialized() {
+ log.Warn("LinuxStatus() is not initalized yet (no parent for the window?)")
+ return
+ }
+ if ls.window != nil {
+ log.Warn("You already have a window")
+ ls.ready = true
+ return
+ }
- // me.window = gadgets.NewBasicWindow(me.myGui, "Linux OS Details")
+ ls.ready = true
+ log.Warn("Creating the Window")
+ ls.window = gadgets.NewBasicWindow(ls.parent, "Linux OS Details")
}