diff options
| author | Jeff Carr <[email protected]> | 2024-01-31 13:34:13 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-31 13:34:13 -0600 |
| commit | 4641eceda817e822b1e4e096086a2227a04bb3fd (patch) | |
| tree | 5960151642ca54cd30fe574e28b463f44ecaf033 /new.go | |
| parent | 1a9b13dda5e13d0786718768443bab4a6916aab9 (diff) | |
Signed-off-by: Jeff Carr <[email protected]>
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 } |
