summaryrefslogtreecommitdiff
path: root/doc.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-06 23:33:27 -0400
committerPietro Gagliardi <[email protected]>2014-04-06 23:33:27 -0400
commitf7817f6987f83d84893466ee4f8a99af98ee643f (patch)
treef5562d591887582e1fd720bbf86c2eb83c7fbbaa /doc.go
parentaf770340c9d73a60a1484fd3793ab3a2d4e1076b (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.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc.go b/doc.go
index a0a1b01..8a545fd 100644
--- a/doc.go
+++ b/doc.go
@@ -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() + "!", "")