new GUI codebase

This commit is contained in:
Jeff Carr 2025-09-09 06:02:35 -05:00
parent 1418fcb0d1
commit 18422baceb
4 changed files with 7 additions and 23 deletions

View File

@ -3,7 +3,6 @@ package main
import ( import (
"os" "os"
"go.wit.com/gui"
"go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/log" "go.wit.com/log"
) )
@ -28,16 +27,3 @@ func doForge() {
log.Info("found repo", me.repo.GetGoPath()) log.Info("found repo", me.repo.GetGoPath())
// build() // build()
} }
func doGui() {
me.myGui = gui.New()
if !argv.Auto {
me.myGui.InitEmbed(resources)
}
me.myGui.Default()
me.basicWindow.Show()
// go will sit here until the window exits
gui.Watchdog()
os.Exit(0)
}

10
main.go
View File

@ -7,6 +7,7 @@ import (
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/lib/fhelp" "go.wit.com/lib/fhelp"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/gui/shell" "go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/log" "go.wit.com/log"
@ -53,12 +54,7 @@ func main() {
} }
// build() // build()
me.myGui = gui.New() me.myGui = prep.Gui() // prepares the GUI package for go-args
if !argv.Auto {
me.myGui.InitEmbed(resources)
}
me.myGui.Default()
me.basicWindow = makebasicWindow() me.basicWindow = makebasicWindow()
// figure out where we are working from // figure out where we are working from
@ -98,6 +94,8 @@ func main() {
os.Exit(0) os.Exit(0)
} }
// only load teh toolkit if you get this far
me.myGui.Start() // loads the GUI toolkit
me.basicWindow.Show() me.basicWindow.Show()
// go will sit here until the window exits // go will sit here until the window exits
gui.Watchdog() gui.Watchdog()

View File

@ -12,7 +12,7 @@ import (
// this is terribly old code. redo this all after widgets are switched to protobuf // this is terribly old code. redo this all after widgets are switched to protobuf
func makebasicWindow() *gadgets.BasicWindow { func makebasicWindow() *gadgets.BasicWindow {
log.Warn("init basicWindow state") log.Warn("init basicWindow state")
win := gadgets.NewBasicWindow(me.myGui, "Create .deb files for GO applications") win := gadgets.RawBasicWindow("Create .deb files for GO applications")
win.Make() win.Make()
win.Custom = func() { win.Custom = func() {
log.Info("got to close") log.Info("got to close")

View File

@ -2,8 +2,8 @@ package main
import ( import (
"go.wit.com/dev/alexflint/arg" "go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
"go.wit.com/lib/gadgets" "go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/prep"
"go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/gitpb"
) )
@ -18,7 +18,7 @@ type mainType struct {
hasWork bool // true if using go.work file hasWork bool // true if using go.work file
forge *forgepb.Forge // the interface to the 'forge' protobuf information forge *forgepb.Forge // the interface to the 'forge' protobuf information
repo *gitpb.Repo // this is the repo we are in repo *gitpb.Repo // this is the repo we are in
myGui *gui.Node // the gui toolkit handle myGui *prep.GuiPrep // the gui toolkit handle
cBox *controlBox // the GUI box in the main window cBox *controlBox // the GUI box in the main window
basicWindow *gadgets.BasicWindow // this is a basic window. the user can open and close it basicWindow *gadgets.BasicWindow // this is a basic window. the user can open and close it
} }