diff options
| author | Jeff Carr <[email protected]> | 2025-09-11 15:42:03 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-11 15:42:03 -0500 |
| commit | fecb3ed9c1eab256458013acebd1e66d40f791ba (patch) | |
| tree | 61443f91a5dd64f49d6e0c703d1c99c8a87e2002 | |
| parent | 7b84ddd64bb7e8a068cf5c0157bc084e1edb3ef1 (diff) | |
work on update
| -rw-r--r-- | doGui.go | 70 | ||||
| -rw-r--r-- | windowControlBox.go | 51 |
2 files changed, 55 insertions, 66 deletions
@@ -3,25 +3,65 @@ package main +import ( + "os" + + "go.wit.com/lib/gadgets" + "go.wit.com/lib/gui/shell" + "go.wit.com/log" +) + // An app to submit patches for the 30 GO GUI repos func doGui() { - win := makebasicWindow() - win.Show() - /* - win := gadgets.NewGenericWindow("testing", "Current Conversations") - win.Custom = func() { - log.Warn("MAIN WINDOW CLOSE") - gui.StandardExit() - os.Exit(0) - } + log.Warn("init basicWindow state") + win := gadgets.RawBasicWindow("Create .deb files for GO applications") + win.Make() + win.Custom = func() { + log.Info("got to close") + os.Exit(0) + } + + box1 := win.Box() + // me.cBox = newControl(box1) + cbox := newControl(box1) + + vbox := box1.Box().Horizontal() + group1 := vbox.NewGroup("controls").Horizontal() // Vertical() + + group1.NewButton("go build", func() { + shell.Run([]string{"go", "build", "-v", "-x"}) + }) - grid := win.Group.RawGrid() + group1.NewButton("read control file", func() { + readControlFile(me.repo) + }) - grid.NewLabel("label worked") - grid.NextRow() + group1.NewButton("write control file", func() { + writeDebianControlFile(me.repo) + }) - grid.NewButton("more", func() { - }) - */ + group1.NewButton("update gui", func() { + updateControl(cbox) + }) + + group1.NewButton("dump repo.Control", func() { + // log.Info("CONTROL:", me.repo.Control) + for v := range me.repo.Control { + log.Info("CONTROL:", v, me.repo.Control[v]) + } + }) + + group1.NewButton("Make .deb", func() { + win.Disable() + if ok, err := buildPackage(me.repo); ok { + log.Info("build worked") + os.Exit(0) + } else { + log.Warn("build failed", err) + } + win.Enable() + }) + + win.Show() } diff --git a/windowControlBox.go b/windowControlBox.go index b8d88df..467a846 100644 --- a/windowControlBox.go +++ b/windowControlBox.go @@ -1,61 +1,10 @@ package main import ( - "os" - "go.wit.com/gui" "go.wit.com/lib/gadgets" - "go.wit.com/lib/gui/shell" - "go.wit.com/log" ) -// This initializes the first window, a group and a button -// this is terribly old code. redo this all after widgets are switched to protobuf -func makebasicWindow() *gadgets.BasicWindow { - log.Warn("init basicWindow state") - win := gadgets.RawBasicWindow("Create .deb files for GO applications") - win.Make() - win.Custom = func() { - log.Info("got to close") - os.Exit(0) - } - - box1 := win.Box() - // me.cBox = newControl(box1) - cbox := newControl(box1) - - vbox := box1.Box().Horizontal() - group1 := vbox.NewGroup("controls").Horizontal() // Vertical() - - group1.NewButton("go build", func() { - shell.Run([]string{"go", "build", "-v", "-x"}) - }) - - group1.NewButton("read control file", func() { - readControlFile(me.repo) - }) - - group1.NewButton("write control file", func() { - writeDebianControlFile(me.repo) - }) - group1.NewButton("update gui", func() { - updateControl(cbox) - }) - - group1.NewButton("Make .deb", func() { - win.Disable() - if ok, err := buildPackage(me.repo); ok { - log.Info("build worked") - os.Exit(0) - } else { - log.Warn("build failed", err) - } - win.Enable() - }) - - return win -} - // This initializes the control box func newControl(parent *gui.Node) *controlBox { var c *controlBox |
