summaryrefslogtreecommitdiff
path: root/cmds/textbox/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-02-25 14:05:25 -0600
committerJeff Carr <[email protected]>2023-02-25 14:05:25 -0600
commitf3bb68396afa7452ecf1c8d4744c825a9d81057c (patch)
tree00b55a17cee7a8e2f795c479a84a844779993c1c /cmds/textbox/main.go
parent355e5ec968427c2b07b78fec12224f31a65df740 (diff)
The debugging window is finally useful
the gui enabled debugging works --gui-debug works from the command line The debug window can now select things debugging now includes widget types all the debug flags work finally working debugging flags via gui checkboxes add debian packaging rules use log() in the toolkit use a standard log() to simplify debugging flags add reference to 'GO Style Guide' use the same LICENSE from the GO developers. TODO: make this threadsafe TODO: fix plugin stuff Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds/textbox/main.go')
-rw-r--r--cmds/textbox/main.go32
1 files changed, 7 insertions, 25 deletions
diff --git a/cmds/textbox/main.go b/cmds/textbox/main.go
index b545d08..b260681 100644
--- a/cmds/textbox/main.go
+++ b/cmds/textbox/main.go
@@ -4,7 +4,6 @@ package main
import (
"os"
"log"
- "fmt"
"git.wit.org/wit/gui"
arg "github.com/alexflint/go-arg"
)
@@ -12,30 +11,20 @@ import (
type LogOptions struct {
LogFile string
Verbose bool
- GuiDebug bool `help:"open up the wit/gui Debugging Window"`
- GuiDemo bool `help:"open the wit/gui Demo Window"`
+ // GuiDebug bool `help:"open up the wit/gui Debugging Window"`
+ // GuiDemo bool `help:"open the wit/gui Demo Window"`
User string `arg:"env:USER"`
}
var args struct {
- Foo string
- Bar bool
LogOptions
- gui.GuiDebug
+ gui.GuiArgs
}
-
func main() {
arg.MustParse(&args)
- fmt.Println(args.Foo, args.Bar, args.User)
-
- gui.Config.Debug.Debug = args.Debug
- /*
- gui.Config.Debug.Change = args.DebugChange
- gui.Config.Debug.Dump = args.DebugDump
- gui.Config.Debug.Node = args.DebugNode
- gui.Config.Debug.Tabs = args.DebugTabs
- */
+ // fmt.Println(args.Foo, args.Bar, args.User)
+ log.Println("Toolkit = ", args.Toolkit)
/*
f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
@@ -48,14 +37,14 @@ func main() {
log.Println("This is a test log entry")
*/
- gui.Init()
+ // gui.InitPlugins([]string{"andlabs"})
gui.Main(initGUI)
}
// This initializes the first window
func initGUI() {
var w *gui.Node
- gui.Config.Title = "Hello World golang wit/gui Window"
+ gui.Config.Title = "Hello World"
gui.Config.Width = 640
gui.Config.Height = 480
gui.Config.Exit = myDefaultExit
@@ -65,16 +54,9 @@ func initGUI() {
addDemoTab(w, "A Simple Tab Demo")
addDemoTab(w, "A Second Tab")
- /*
- TODO: add these back
- if (args.GuiDemo) {
- gui.DemoToolkitWindow()
- }
-
if (args.GuiDebug) {
gui.DebugWindow()
}
- */
}
func addDemoTab(window *gui.Node, title string) {