summaryrefslogtreecommitdiff
path: root/new.go
blob: 17d87c91f566f17880f571a9b76002d4a243fd2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This creates a simple hello world window
package linuxstatus

import (
	"go.wit.com/gui"
	"go.wit.com/log"

	"go.wit.com/lib/gadgets"
)

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
	}
	me = &LinuxStatus{
		hidden: true,
		ready:  false,
	}
	me.ifmap = make(map[int]*IFtype)
	me.ipmap = make(map[string]*IPtype)

	log.Log(WARN, "Creating the Window")
	me.window = gadgets.NewBasicWindow(parent, "OS Hostname Details")
	me.window.Make()
	draw(me)
	me.window.Draw()

	me.ready = true
	return me
}