new GUI changes
This commit is contained in:
parent
63be841469
commit
24e137c7ec
24
doGui.go
24
doGui.go
|
@ -9,7 +9,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/fhelp"
|
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/shell"
|
"go.wit.com/lib/gui/shell"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -33,26 +32,6 @@ func debug() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func doGui() {
|
func doGui() {
|
||||||
if me.forge.Config.GetDefaultGui() == "" {
|
|
||||||
me.forge.Config.DefaultGui = "gocui"
|
|
||||||
me.forge.ConfigSave()
|
|
||||||
}
|
|
||||||
me.myGui = gui.New()
|
|
||||||
me.myGui.InitEmbed(resources)
|
|
||||||
me.myGui.SetAppDefaultPlugin(me.forge.Config.DefaultGui) // sets the default GUI plugin to use
|
|
||||||
if pname, err := me.myGui.Default(); err != nil {
|
|
||||||
if !fhelp.BuildPlugin("gocui") {
|
|
||||||
log.Info("You can't run the forge GUI since the plugins did not build", pname)
|
|
||||||
okExit("")
|
|
||||||
} else {
|
|
||||||
if err := me.myGui.LoadToolkitNew("gocui"); err != nil {
|
|
||||||
log.Info("The plugins built, but still failed to load", pname)
|
|
||||||
badExit(err)
|
|
||||||
}
|
|
||||||
log.Info("The plugins built and loaded!", pname)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mainWindow := gadgets.NewGenericWindow("forged: forge.wit.com", "Current Settings")
|
mainWindow := gadgets.NewGenericWindow("forged: forge.wit.com", "Current Settings")
|
||||||
mainWindow.Custom = func() {
|
mainWindow.Custom = func() {
|
||||||
log.Warn("MAIN WINDOW CLOSE")
|
log.Warn("MAIN WINDOW CLOSE")
|
||||||
|
@ -61,9 +40,6 @@ func doGui() {
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
drawWindow(mainWindow)
|
drawWindow(mainWindow)
|
||||||
|
|
||||||
// sits here forever
|
|
||||||
debug()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func drawWindow(win *gadgets.GenericWindow) {
|
func drawWindow(win *gadgets.GenericWindow) {
|
||||||
|
|
4
main.go
4
main.go
|
@ -69,7 +69,9 @@ func main() {
|
||||||
|
|
||||||
if argv.Daemon == true {
|
if argv.Daemon == true {
|
||||||
if argv.Gui != nil {
|
if argv.Gui != nil {
|
||||||
go doGui()
|
me.myGui.Start() // loads the GUI toolkit
|
||||||
|
doGui() // start making our forge GUI
|
||||||
|
debug() // sits here forever
|
||||||
}
|
}
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
okHandlerFunc := http.HandlerFunc(okHandler)
|
okHandlerFunc := http.HandlerFunc(okHandler)
|
||||||
|
|
|
@ -5,7 +5,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go.wit.com/dev/alexflint/arg"
|
"go.wit.com/dev/alexflint/arg"
|
||||||
"go.wit.com/gui"
|
"go.wit.com/lib/gui/prep"
|
||||||
"go.wit.com/lib/protobuf/forgepb"
|
"go.wit.com/lib/protobuf/forgepb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -15,5 +15,5 @@ var me *mainType
|
||||||
type mainType struct {
|
type mainType struct {
|
||||||
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
|
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
|
||||||
forge *forgepb.Forge // for holding the forge protobuf files
|
forge *forgepb.Forge // for holding the forge protobuf files
|
||||||
myGui *gui.Node // the gui toolkit handle
|
myGui *prep.GuiPrep // the gui toolkit handle
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue