From bb6de0de48e96193cfba59042bdca9aa1eefb67f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 8 Jun 2014 12:56:04 -0400 Subject: Cleaned up dialog documentation. --- doc.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'doc.go') diff --git a/doc.go b/doc.go index 80146e9..3422f48 100644 --- a/doc.go +++ b/doc.go @@ -41,5 +41,30 @@ Here is a simple, complete program that asks the user for their name and greets panic(err) } } + +On Dialogs + +The following functions provide dialogs. They exist both in package scope and as methods on Window. + + MsgBox() + MsgBoxError() + +Dialogs opened by using the package-scope functions are modal to the entire application: the user cannot interact with any other window until they are dismissed. +Whether or not resizing Windows will still be allowed is implementation-defined; if the implementation does allow it, resizes will still work properly. +Whether or not the dialog box stays above all other Windows in the program is also implementation-defined. + +Dialogs opened by using the Window methods are modal to the receiver Window only. +Attempts to interact with the receiver Window will be blocked, but all other Windows in the application can still be used properly. +The dialog box will also stay above the receiver Window. +Whether the receiver Window can be resized while the dialog box is displayed is implementation-defined, but will work properly if allowed. +If the receiver Window has not yet been created, the methods panic. +If the receiver Window has not been shown yet or is currently hidden, what the methods do is implementation-defined. + +The return type also differs between the two types of functions. +Both ultimately either yield a signal that the dialog has been dismissed or a code specifying what the user decided to do with the dialog (if it has multiple choices). +The package-scope functions wait for the dialog box to be dismissed and merely return the code (or nothing if no code is needed). +The Window methods return immediately with a channel that will eventually receive either the signal or the return code. +Package ui does not close these channels, nor does it send multiple values on the same channel. + */ package ui -- cgit v1.2.3