summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-08 23:22:47 -0500
committerJeff Carr <[email protected]>2022-10-08 23:22:47 -0500
commit086986b6b8f55d15d18595bcbf3f76c023365b61 (patch)
tree9f1dc4da5b2d125f7a017418d4d9912e16b71039 /main.go
parentf92a50e2e665a18e2201f1d6714025dcc39301cc (diff)
parent45644ef9bc333f5def62d1c7f474dc96274e63fa (diff)
Merge branch 'master' into jcarr
Diffstat (limited to 'main.go')
-rw-r--r--main.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..70e0e65
--- /dev/null
+++ b/main.go
@@ -0,0 +1,34 @@
+package gui
+
+import (
+ "log"
+
+ "github.com/andlabs/ui"
+ _ "github.com/andlabs/ui/winmanifest"
+)
+
+func Main(f func()) {
+ log.Println("Starting gui.Main() (using gtk via andlabs/ui)")
+ ui.Main(f)
+}
+
+// Other goroutines must use this to access the GUI
+//
+// 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())
+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")
+}
+*/