From f7817f6987f83d84893466ee4f8a99af98ee643f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 6 Apr 2014 23:33:27 -0400 Subject: 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. --- doc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc.go') 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() + "!", "") -- cgit v1.2.3