diff options
Diffstat (limited to 'new.go')
| -rw-r--r-- | new.go | 26 |
1 files changed, 9 insertions, 17 deletions
@@ -2,12 +2,13 @@ package linuxstatus import ( + "go.wit.com/gui" "go.wit.com/log" "go.wit.com/lib/gadgets" ) -func New() *LinuxStatus { +func NewLinuxStatus(parent *gui.Node) *LinuxStatus { if me != nil { log.Log(WARN, "You have done New() twice. You can only do this once") return me @@ -19,21 +20,12 @@ func New() *LinuxStatus { 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 + me.window = gadgets.NewBasicWindow(parent, "OS Hostname Details") + me.window.Make() + draw(me) + me.window.Draw() + + me.ready = true + return me } |
