From f11db8e7779a55b9dac277243dd3c4fe6fbd9a2e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 6 Oct 2021 10:43:58 -0500 Subject: REFACTOR: continue to move in a better direction Signed-off-by: Jeff Carr --- main.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index eb9bdb4..5e4d1b4 100644 --- a/main.go +++ b/main.go @@ -1,9 +1,11 @@ package gui -import "log" +import ( + "log" -import "github.com/andlabs/ui" -import _ "github.com/andlabs/ui/winmanifest" + "github.com/andlabs/ui" + _ "github.com/andlabs/ui/winmanifest" +) func Main(f func()) { log.Println("Starting gui.Main() (using gtk via andlabs/ui)") @@ -13,7 +15,7 @@ func Main(f func()) { // Other goroutines must use this // // You can not acess / process the GUI thread directly from -// other goroutines. This is due to the nature of how +// 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()) { @@ -21,16 +23,15 @@ func Queue(f func()) { ui.QueueMain(f) } -// gui.Main( -// gui.MainExample() -// ) -func MainExample() { - name := "jcarr" - log.Println("gui.initUI() inside ui.Main()") +// gui.Main(gui.MainExample()) +func ExampleWindow() { + log.Println("START gui.ExampleWindow()") - box := InitWindow(nil, "StartNewWindow" + name, 0) + title := "Test Window" + box := InitWindow(nil, title, 0) window := box.Window - log.Println("StartNewWindow() box =", box) + log.Println("box =", box) + log.Println("window =", window) window.UiWindow.Show() } -- cgit v1.2.3