summaryrefslogtreecommitdiff
path: root/doc.go
diff options
context:
space:
mode:
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() + "!", "")