summaryrefslogtreecommitdiff
path: root/new.go
diff options
context:
space:
mode:
Diffstat (limited to 'new.go')
-rw-r--r--new.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/new.go b/new.go
new file mode 100644
index 0000000..c18480e
--- /dev/null
+++ b/new.go
@@ -0,0 +1,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
+}