diff options
| -rw-r--r-- | examples/basicwindow/basicwindow.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/examples/basicwindow/basicwindow.go b/examples/basicwindow/basicwindow.go new file mode 100644 index 0000000..8b3b4a2 --- /dev/null +++ b/examples/basicwindow/basicwindow.go @@ -0,0 +1,31 @@ +package main + +import ( + "github.com/andlabs/ui" + "log" +) + +func main() { + + go ui.Do(gui) + + err := ui.Go() + if err != nil { + log.Print(err) + } +} + +func gui() { + + // Here we create a new space + newControl := ui.Space() + + // Then we create a window + w := ui.NewWindow("Window", 280, 350, newControl) + w.OnClosing(func() bool { + ui.Stop() + return true + }) + + w.Show() +} |
