diff options
| author | Pietro Gagliardi <[email protected]> | 2014-04-06 23:33:27 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-04-06 23:33:27 -0400 |
| commit | f7817f6987f83d84893466ee4f8a99af98ee643f (patch) | |
| tree | f5562d591887582e1fd720bbf86c2eb83c7fbbaa /doc.go | |
| parent | af770340c9d73a60a1484fd3793ab3a2d4e1076b (diff) | |
Added (untested; VM issues) code to handle Mac OS X Quit Dock menu items and other related stuff that may happen in the future. Will drop the TODO after I can test it.
Diffstat (limited to 'doc.go')
| -rw-r--r-- | doc.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -20,6 +20,7 @@ Here is a simple, complete program that asks the user for their name and greets func myMain() { w := ui.NewWindow("Hello", 400, 100) + ui.AppQuit = w.Closing // treat quitting the application like closing the main window nameField := ui.NewLineEdit("Enter Your Name Here") button := ui.NewButton("Click Here For a Greeting") err := w.Open(ui.NewVerticalStack(nameField, button)) @@ -29,7 +30,7 @@ Here is a simple, complete program that asks the user for their name and greets for { select { - case <-w.Closing: // user tries to close the window + case <-w.Closing: // user tries to close the window or quit the program return case <-button.Clicked: // user clicked the button ui.MsgBox("Hello, " + nameField.Text() + "!", "") |
