summaryrefslogtreecommitdiff
path: root/new.go
blob: c18480e00be658cf63ce4643a498f4db57a73449 (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
32
33
34
35
package repostatus

import 	(
	"go.wit.com/log"

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

func New(p *gui.Node, path string) *RepoStatus {
	rs := &RepoStatus {
		hidden: true,
		ready: false,
		parent: p,
		repopath: path,
	}
	rs.tags = make(map[string]string)
	return rs
}

func (rs *RepoStatus) InitWindow() {
	if ! rs.Initialized() {
		log.Log(WARN, "not initalized yet (no parent for the window?)")
		return
	}
	if rs.window != nil {
		log.Log(WARN, "You already have a window")
		rs.ready = true
		return
	}

	log.Log(WARN, "Creating the Window")
	rs.window = gadgets.NewBasicWindow(rs.parent, "GO Repo Details")
	rs.ready = true
}