diff options
| author | Jeff Carr <[email protected]> | 2021-10-06 10:43:58 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2021-10-06 10:43:58 -0500 |
| commit | f11db8e7779a55b9dac277243dd3c4fe6fbd9a2e (patch) | |
| tree | e591bf86d5a439327b30c5e26722cd134e122e13 /main.go | |
| parent | 504a067503e9d0dc4ce473eb1890276f485504c7 (diff) | |
REFACTOR: continue to move in a better direction
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -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() } |
