diff options
| author | Pietro Gagliardi <[email protected]> | 2016-05-30 00:14:46 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2016-05-30 00:14:46 -0400 |
| commit | 52f7d276a6bb04b8827ac019ad1e135b43819cea (patch) | |
| tree | 5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/examples/basicwindow/basicwindow.go | |
| parent | c9b32c1333e4009b342eedc5f5b39127a724fb42 (diff) | |
Removed prev/.
Diffstat (limited to 'prev/examples/basicwindow/basicwindow.go')
| -rw-r--r-- | prev/examples/basicwindow/basicwindow.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/prev/examples/basicwindow/basicwindow.go b/prev/examples/basicwindow/basicwindow.go deleted file mode 100644 index c0259f5..0000000 --- a/prev/examples/basicwindow/basicwindow.go +++ /dev/null @@ -1,37 +0,0 @@ -package main - -import ( - "github.com/andlabs/ui" - "log" -) - -func main() { - // This runs the code that displays our GUI. - // All code that interfaces with package ui (except event handlers) must be run from within a ui.Do() call. - go ui.Do(gui) - - err := ui.Go() - if err != nil { - log.Print(err) - } -} - -func gui() { - // All windows must have a control inside. - // ui.Space() creates a control that is just a blank space for us to use. - newControl := ui.Space() - - // Then we create a window. - w := ui.NewWindow("Window", 280, 350, newControl) - - // We tell package ui to destroy our window and shut down cleanly when the user closes the window by clicking the X button in the titlebar. - w.OnClosing(func() bool { - // This informs package ui to shut down cleanly when it can. - ui.Stop() - // And this informs package ui that we want to hide AND destroy the window. - return true - }) - - // And finally, we need to show the window. - w.Show() -} |
