summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go25
1 files changed, 17 insertions, 8 deletions
diff --git a/main.go b/main.go
index bbd9c0a..7af7d4a 100644
--- a/main.go
+++ b/main.go
@@ -1,17 +1,18 @@
package main
import (
+ "os"
+
+ "go.wit.com/dev/alexflint/arg"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
+ "go.wit.com/lib/gui/prep"
"go.wit.com/log"
)
// sent via -ldflags
var VERSION string
-// This is the beginning of the binary tree of widgets
-var myGui *gui.Node
-
// this is the primary window. If you close it, the program will exit
var mainWindow *gui.Node
@@ -25,20 +26,28 @@ var computers *gui.Node
var colors *gui.Node
func main() {
- myGui = gui.New()
- myGui.Default()
- myGui.LoadToolkit("gocui")
+ me := new(mainType)
+ me.myGui = prep.Gui() // prepares the GUI package for go-args
+ me.pp = arg.MustParse(&argv)
+
+ // for very new users or users unfamilar with the command line, this may help them
+ if argv.Demo == "version" || argv.Demo == "help" || argv.Demo == "?" {
+ me.pp.WriteHelp(os.Stdout)
+ os.Exit(0)
+ }
+
+ me.myGui.Start() // loads the GUI toolkit (GO Plugins)
helloworld()
basicWindow = makebasicWindow()
- // go will sit here until the window exits
+ // use this or make a loop to do something
gui.Watchdog()
}
// This initializes the first window and some widgets
func helloworld() {
- mainWindow = myGui.NewWindow("primary helloworld window").SetProgName("BASEWIN1")
+ mainWindow = gui.RawWindow("primary helloworld window").SetProgName("BASEWIN1")
box := mainWindow.NewBox("vbox", false)
group := box.NewGroup("choices")