summaryrefslogtreecommitdiff
path: root/new.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-15 19:24:48 -0600
committerJeff Carr <[email protected]>2024-01-15 19:24:48 -0600
commitfdac7e7b8944d51b8207c1797edd0be9450de7b8 (patch)
tree9e762c05ea6f716dc9434dae1e852630bd6c0ec5 /new.go
parent94aa368cff322e667156571638a45bd3117a2739 (diff)
restore the files after garbage collectionv0.5.5
hopefully this actually is a valid git repo
Diffstat (limited to 'new.go')
-rw-r--r--new.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/new.go b/new.go
new file mode 100644
index 0000000..4ae57eb
--- /dev/null
+++ b/new.go
@@ -0,0 +1,39 @@
+// This creates a simple hello world window
+package linuxstatus
+
+import (
+ "go.wit.com/log"
+
+ "go.wit.com/gui/gadgets"
+)
+
+func New() *LinuxStatus {
+ if me != nil {
+ log.Log(WARN, "You have done New() twice. You can only do this once")
+ return me
+ }
+ me = &LinuxStatus {
+ hidden: true,
+ ready: false,
+ }
+ me.ifmap = make(map[int]*IFtype)
+ me.ipmap = make(map[string]*IPtype)
+
+ return me
+}
+
+func (ls *LinuxStatus) InitWindow() {
+ if ! ls.Initialized() {
+ log.Log(WARN, "not initalized yet (no parent for the window?)")
+ return
+ }
+ if ls.window != nil {
+ log.Log(WARN, "You already have a window")
+ ls.ready = true
+ return
+ }
+
+ log.Log(WARN, "Creating the Window")
+ ls.window = gadgets.NewBasicWindow(ls.parent, "Linux OS Details")
+ ls.ready = true
+}