From c22d0f48664d9ea5d89a64a32dcac1db956efc67 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 14 Jan 2024 01:59:19 -0600 Subject: [PATCH] grid.Margin() works Signed-off-by: Jeff Carr --- main.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index c3b8687..5811d8b 100644 --- a/main.go +++ b/main.go @@ -49,8 +49,8 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri log.Warn("status window doesn't exist") return } - log.Warn("status window exists. trying Update() here") - newRepo.status.Toggle() + log.Warn("status window exists. trying Show() here") + newRepo.status.Show() }) grid.NewButton("TestDraw()", func () { if newRepo.status == nil { @@ -65,9 +65,6 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri newRepo.pButton.Hide() } newRepo.status = repostatus.New(myGui, newRepo.path) - newRepo.status.Horizontal() - newRepo.status.Make() - newRepo.status.Make2() newRepo.status.SetMasterName(master) newRepo.status.SetDevelName(devel) newRepo.status.SetUserName(user) @@ -84,6 +81,7 @@ func repoworld() { // box2 := win.Box().NewBox("bw vbox", false) group := box.NewGroup("go repositories (read from ~/.config/myrepolist)") grid := group.NewGrid("test", 11, 1) + grid.Margin() grid.NewLabel("") grid.NewLabel("branch") @@ -109,5 +107,22 @@ func repoworld() { addRepo(grid, path, mbranch, dbranch, ubranch) } + box2 := win.Box().NewBox("bw vbox", false) + box2.NewButton("grid.Pad()", func () { + grid.Margin() + }) + + box2.NewButton("status.Update() all", func () { + for _, repo := range allrepos { + repo.status.Update() + } + }) + + box2.NewButton("rescan all", func () { + for _, repo := range allrepos { + repo.newScan() + } + }) + win.Draw() }