package main import ( "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/repolist" "go.wit.com/log" "go.wit.com/gui" ) type repoWindow struct { win *gadgets.BasicWindow box *gui.Node // the top box of the repolist window topbox *gui.Node View *repolist.RepoList } func (r *repoWindow) Hidden() bool { return r.win.Hidden() } func (r *repoWindow) Show() { r.win.Show() } func (r *repoWindow) Hide() { r.win.Hide() } func (r *repoWindow) Disable() { r.box.Disable() } func (r *repoWindow) Enable() { r.box.Enable() } // you can only have one of these func makeRepoView() *repoWindow { if me.repos != nil { return me.repos } r := new(repoWindow) r.win = gadgets.RawBasicWindow("All git repositories in ~/go/src/") r.win.Make() r.box = r.win.Box().NewBox("bw vbox", false) // me.reposwin.Draw() r.win.Custom = func() { log.Warn("GOT HERE: main() gadgets.NewBasicWindow() close") log.Warn("Should I do something special here?") } r.topbox = r.repoMenu() r.View = repolist.InitBox(me.forge, r.box) r.View.Enable() r.View.ScanRepositories() return r } func (r *repoWindow) repoMenu() *gui.Node { // reposbox.SetExpand(false) group1 := r.box.NewGroup("") hbox := group1.Box() // hbox.Horizontal() hbox.Vertical() box2 := hbox.Box().Vertical() return box2 }