summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-20 06:55:42 -0500
committerJeff Carr <[email protected]>2022-10-20 06:55:42 -0500
commitb8ef0bb05dc14bc4291f3d156b199fa125cdb9d7 (patch)
tree71280d7f01805dfbd430f71df16858079686b8fc /main.go
parentf3af1f5b7ff78b3f73d7510622fc9633dec36d35 (diff)
Squashed commit of the following:
all non binary tree structs are gone (almost all) Use names from https://en.wikipedia.org/wiki/Graphical_widget toolkit andlabs/ui is isolated from being accessable all direct references to andlabs are removed working dropdown widgets add debugging more buttons and windows
Diffstat (limited to 'main.go')
-rw-r--r--main.go46
1 files changed, 30 insertions, 16 deletions
diff --git a/main.go b/main.go
index 70e0e65..bf4a2cf 100644
--- a/main.go
+++ b/main.go
@@ -2,14 +2,38 @@ package gui
import (
"log"
-
- "github.com/andlabs/ui"
- _ "github.com/andlabs/ui/winmanifest"
)
+import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
+
+
+// the _ means we only need this for the init()
+
+const Xaxis = 0 // box that is horizontal
+const Yaxis = 1 // box that is vertical
+
+func init() {
+ log.Println("gui.init() has been run")
+
+ Config.counter = 0
+ Config.prefix = "wit"
+ Config.DebugNode = false
+ Config.DebugTabs = false
+
+ title := "master"
+ w := 640
+ h := 480
+ f := StandardClose
+
+ Config.master = addNode(title, w, h)
+ Config.master.custom = f
+
+ Config.master.Dump()
+}
+
func Main(f func()) {
log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
- ui.Main(f)
+ toolkit.Main(f)
}
// Other goroutines must use this to access the GUI
@@ -17,18 +41,8 @@ func Main(f func()) {
// You can not acess / process the GUI thread directly from
// other goroutines. This is due to the nature of how
// Linux, MacOS and Windows work (they all work differently. suprise. surprise.)
-// For example: gui.Queue(addNewTabForColorSelection())
+// For example: gui.Queue(NewWindow())
func Queue(f func()) {
log.Println("Sending function to gui.Main() (using gtk via andlabs/ui)")
- ui.QueueMain(f)
-}
-
-/*
-func ExampleWindow() {
- log.Println("START gui.ExampleWindow()")
-
- Config.Title = "ExampleWindow"
- node := NewWindow()
- node.AddDebugTab("jcarr Debug")
+ toolkit.Queue(f)
}
-*/