2024-01-06 05:24:11 -06:00
|
|
|
// This creates a simple hello world window
|
|
|
|
package linuxstatus
|
|
|
|
|
|
|
|
import (
|
2024-01-06 05:55:51 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
|
|
|
|
"go.wit.com/gui/gadgets"
|
2024-01-06 05:24:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func New() *LinuxStatus {
|
2024-01-06 05:55:51 -06:00
|
|
|
if me != nil {
|
2024-01-06 11:12:10 -06:00
|
|
|
log.Log(WARN, "You have done New() twice. You can only do this once")
|
2024-01-06 05:55:51 -06:00
|
|
|
return me
|
|
|
|
}
|
2024-01-06 05:24:11 -06:00
|
|
|
me = &LinuxStatus {
|
|
|
|
hidden: true,
|
|
|
|
ready: false,
|
|
|
|
}
|
2024-01-06 11:12:10 -06:00
|
|
|
me.ifmap = make(map[int]*IFtype)
|
|
|
|
me.ipmap = make(map[string]*IPtype)
|
2024-01-06 05:24:11 -06:00
|
|
|
|
|
|
|
return me
|
2024-01-06 05:55:51 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (ls *LinuxStatus) InitWindow() {
|
|
|
|
if ! ls.Initialized() {
|
2024-01-06 11:12:10 -06:00
|
|
|
log.Log(WARN, "not initalized yet (no parent for the window?)")
|
2024-01-06 05:55:51 -06:00
|
|
|
return
|
|
|
|
}
|
|
|
|
if ls.window != nil {
|
2024-01-06 11:12:10 -06:00
|
|
|
log.Log(WARN, "You already have a window")
|
2024-01-06 05:55:51 -06:00
|
|
|
ls.ready = true
|
|
|
|
return
|
|
|
|
}
|
2024-01-06 05:24:11 -06:00
|
|
|
|
2024-01-06 11:12:10 -06:00
|
|
|
log.Log(WARN, "Creating the Window")
|
2024-01-06 05:55:51 -06:00
|
|
|
ls.window = gadgets.NewBasicWindow(ls.parent, "Linux OS Details")
|
2024-01-06 11:12:10 -06:00
|
|
|
ls.ready = true
|
2024-01-06 05:24:11 -06:00
|
|
|
}
|