more testing

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-08 13:02:43 -06:00
parent b992949060
commit 9b4bf224dc
3 changed files with 24 additions and 15 deletions

View File

@ -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)
})

16
gui.go
View File

@ -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")

21
testSmartWindow.go Normal file
View File

@ -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")
}