summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-12 10:04:36 -0600
committerJeff Carr <[email protected]>2024-02-12 10:04:36 -0600
commit9f35ee8d3c8d1b37244927585f363ee84167a441 (patch)
treeb61ad27fb3b61106edb5a643f3c5a43afba4e172
parent52f207a1055c46526f597316b04aad714625d859 (diff)
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--Makefile15
-rw-r--r--debugger.go26
-rw-r--r--main.go2
3 files changed, 35 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 3c55c85..6dce3b4 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ all: build
build:
ifeq ($(GO111MODULE),)
- echo no. you must use GO111MODULE here
+ echo no. you must use GO111MODULE to build here
false
else
-rm -f basicwindow
@@ -12,13 +12,14 @@ else
endif
stderr: build
- echo "writing to /tmp/basicwindow.stderr"
- ./basicwindow >/tmp/basicwindow.stderr 2>&1
+ echo "writing to /tmp/basicwindow.out"
+ ./basicwindow >/tmp/basicwindow.out 2>&1
-push:
- git add --all
- git commit -a
- git push
+gocui:
+ ./basicwindow --gui gocui >/tmp/basicwindow.out 2>&1
+
+goimports:
+ goimports -w *.go
redomod:
rm -f go.*
diff --git a/debugger.go b/debugger.go
new file mode 100644
index 0000000..116d549
--- /dev/null
+++ b/debugger.go
@@ -0,0 +1,26 @@
+package main
+
+/*
+ enables GUI options and the debugger in your application
+*/
+
+import (
+ "go.wit.com/dev/alexflint/arg"
+ "go.wit.com/lib/debugger"
+ "go.wit.com/log"
+)
+
+var args struct {
+}
+
+func init() {
+ arg.MustParse(&args)
+
+ if debugger.ArgDebug() {
+ log.Info("cmd line --debugger == true")
+ go func() {
+ log.Sleep(2)
+ debugger.DebugWindow()
+ }()
+ }
+}
diff --git a/main.go b/main.go
index 66e7064..5aa8ef8 100644
--- a/main.go
+++ b/main.go
@@ -35,7 +35,7 @@ func main() {
// This initializes the first window and some widgets
func helloworld() {
- mainWindow = myGui.NewWindow("hello world").SetProgName("BASEWIN1")
+ mainWindow = myGui.NewWindow("primary helloworld window").SetProgName("BASEWIN1")
box := mainWindow.NewBox("vbox", false)
group := box.NewGroup("choices")