summaryrefslogtreecommitdiff
path: root/toolkit/democui/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-03-26 17:19:20 -0500
committerJeff Carr <[email protected]>2023-03-26 17:19:20 -0500
commit6013fde8332e8ecbffaf1a0977ba2e1da8ea8775 (patch)
tree3f9ccd75e8699974f3412fdd79a20173672c19c2 /toolkit/democui/main.go
parent6f91f5e080e06cdc0f34b13d23e5fd16ea37259a (diff)
improvements towards a working dns control panel
democui has the help menu try to add mouse support to gocui make a direct access method Margin() and Pad() tests add SPEW also push devel branch to github Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/democui/main.go')
-rw-r--r--toolkit/democui/main.go58
1 files changed, 58 insertions, 0 deletions
diff --git a/toolkit/democui/main.go b/toolkit/democui/main.go
new file mode 100644
index 0000000..1e0e3d8
--- /dev/null
+++ b/toolkit/democui/main.go
@@ -0,0 +1,58 @@
+// Copyright 2014 The gocui Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+ "os"
+)
+
+func OnExit(f func(string)) {
+ Custom = f
+}
+
+func Init() {
+ log("Init() of democui")
+}
+
+func Exit() {
+ g.Close()
+}
+
+func mouseClick(name string) {
+ // output screws up the console. Need to fix this by redirecting all console output to a file from log.Println()
+ // log.Println("g.Close()")
+ // g.Close()
+
+ log("Found andlabs Running custom function for the mouse click")
+ Custom(name)
+ // panic("got andlabs")
+}
+
+func Main(f func()) {
+ log("start Init()")
+
+ outf, err := os.OpenFile("/tmp/witgui.log", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
+ if err != nil {
+ exit("error opening file: %v", err)
+ }
+ defer outf.Close()
+
+ setOutput(outf)
+ log("This is a test log entry")
+
+ MouseMain()
+}
+
+/*
+func StartConsoleMouse() {
+ defer g.Close()
+ log("start Main()")
+
+ if err := g.MainLoop(); err != nil && !errors.Is(err, gocui.ErrQuit) {
+ exit(err)
+ }
+ log("exit Main()")
+}
+*/