From 9b4bf224dcf4a7d29433be25e73d33b45b670d0b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 8 Jan 2024 13:02:43 -0600 Subject: [PATCH] more testing Signed-off-by: Jeff Carr --- errorBox.go | 2 +- gui.go | 16 ++-------------- testSmartWindow.go | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 testSmartWindow.go diff --git a/errorBox.go b/errorBox.go index 1e6cbf4..72a7940 100644 --- a/errorBox.go +++ b/errorBox.go @@ -95,7 +95,7 @@ func (eb *errorBox) add(kind string, ip string) bool { anErr.kindLabel = eb.grid.NewLabel(kind) anErr.ipLabel = eb.grid.NewLabel(ip) anErr.statusLabel = eb.grid.NewLabel("") - anErr.button = eb.grid.NewButton(kind, func() { + anErr.button = eb.grid.NewButton("Fix", func() { log.Log(WARN, "got", kind, "here. IP =", ip) eb.fix(tmp) }) diff --git a/gui.go b/gui.go index 06f10ee..719bf13 100644 --- a/gui.go +++ b/gui.go @@ -110,29 +110,17 @@ func mainWindow(title string) { me.fixWindow = smartwindow.New() me.fixWindow.SetParent(me.myGui) me.fixWindow.Title("smart window test") - me.fixWindow.SetDraw(drawFixWindow) + me.fixWindow.SetDraw(testSmartWindow) me.fixWindow.Vertical() me.fixWindow.Make() me.fixWindow.Draw() me.fixWindow.Hide() return } + me.fixWindow.Toggle() }) gr.NewButton("Show Errors", func () { - /* - if me.fixWindow == nil { - me.fixWindow = smartwindow.New() - me.fixWindow.SetParent(me.myGui) - me.fixWindow.Title("fix window") - me.fixWindow.SetDraw(drawFixWindow) - me.fixWindow.Vertical() - me.fixWindow.Make() - me.fixWindow.Draw() - me.fixWindow.Hide() - return - } - */ me.problems.Toggle() }) me.autofix = gr.NewCheckbox("Auto-correct Errors") diff --git a/testSmartWindow.go b/testSmartWindow.go new file mode 100644 index 0000000..354cc78 --- /dev/null +++ b/testSmartWindow.go @@ -0,0 +1,21 @@ +// testing the smart window +package main + +import ( + "go.wit.com/log" + // "go.wit.com/gui/cloudflare" + "go.wit.com/apps/control-panel-dns/smartwindow" +) + +func testSmartWindow(sw *smartwindow.SmartWindow) { + log.Log(WARN, "testSmartWindow() START") + grid := sw.Box().NewGrid("test", 5, 1) + grid.NewLabel("test 1") + grid.NewLabel("test 1") + grid.NewLabel("test 2") + grid.NewLabel("test 2") + grid.NewLabel("test 3") + grid.NewLabel("test 3") + grid.NewLabel("test 3") + grid.NewLabel("test 3") +}