hide extra windows by default

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-05 00:11:48 -06:00
parent ff21dba712
commit fdcd51d211
3 changed files with 14 additions and 6 deletions

View File

@ -2,7 +2,7 @@
run: build
# ./control-panel-dns >/tmp/witgui.log.stderr 2>&1
./control-panel-dns --debugger
./control-panel-dns
install:
go install -v go.wit.com/control-panel-dns@latest

17
gui.go
View File

@ -25,7 +25,7 @@ func setupControlPanelWindow() {
// setup the main tab
mainWindow("DNS and IPv6 Control Panel")
detailsTab("Details")
detailsTab("DNS Details")
debugTab("Debug")
// me.digStatus = NewDigStatusWindow(me.window)
@ -70,14 +70,16 @@ func detailsTab(title string) {
grid.Margin()
grid.Pad()
me.details.Hide()
}
func debugTab(title string) {
var g2 *gui.Node
win := gadgets.NewBasicWindow(me.myGui, title)
me.debug = gadgets.NewBasicWindow(me.myGui, title)
g2 = win.Box().NewGroup("Real Stuff")
g2 = me.debug.Box().NewGroup("Real Stuff")
g2.NewButton("GO GUI Debug Window", func () {
debugger.DebugWindow(me.myGui)
@ -97,7 +99,7 @@ func debugTab(title string) {
log.Println(o)
})
g2 = win.Box().NewGroup("debugging options")
g2 = me.debug.Box().NewGroup("debugging options")
// makes a slider widget
me.ttl = gadgets.NewDurationSlider(g2, "Loop Timeout", 10 * time.Millisecond, 5 * time.Second)
@ -109,6 +111,8 @@ func debugTab(title string) {
g2.Margin()
g2.Pad()
me.debug.Hide()
}
// will return a AAAA value that needs to be deleted
@ -273,9 +277,12 @@ func mainWindow(title string) {
gr.NewButton("GO GUI Debugger", func () {
debugger.DebugWindow(me.myGui)
})
gr.NewButton("Details", func () {
gr.NewButton("DNS Details", func () {
me.details.Toggle()
})
gr.NewButton("DNS Debug", func () {
me.debug.Toggle()
})
}
func statusGrid(n *gui.Node) {

View File

@ -43,6 +43,7 @@ type Host struct {
window *gadgets.BasicWindow // the main window
details *gadgets.BasicWindow // more details of the DNS state
debug *gadgets.BasicWindow // more attempts to debug the DNS state
tab *gui.Node // the main dns tab
notes *gui.Node // using this to put notes here