From 4641eceda817e822b1e4e096086a2227a04bb3fd Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 31 Jan 2024 13:34:13 -0600 Subject: remove testing code Signed-off-by: Jeff Carr --- new.go | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'new.go') diff --git a/new.go b/new.go index 22a2e59..17d87c9 100644 --- a/new.go +++ b/new.go @@ -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 } -- cgit v1.2.3