Update ui.Go() documentation to show that it will return nil when its main() returns now that that behavior is fully implemented.

This commit is contained in:
Pietro Gagliardi 2014-03-05 20:11:45 -05:00
parent d29e1b8710
commit f16005c3db
2 changed files with 3 additions and 2 deletions

View File

@ -3,7 +3,9 @@ package ui
// Go sets up the UI environment and runs main in a goroutine. // Go sets up the UI environment and runs main in a goroutine.
// If initialization fails, Go returns an error and main is not called. // If initialization fails, Go returns an error and main is not called.
// Otherwise, Go does not return to its caller until (unless? TODO) the application loop exits, at which point it returns nil. // Otherwise, Go does not return to its caller until main does, at which point it returns nil.
// After it returns, you cannot call future ui functions/methods meaningfully.
// (TODO ideally we would want to be able to call ui.MsgBoxError() to report failures to the user, but I would need to figure out how to do this on platforms other than Windows.)
// //
// This model is undesirable, but Cocoa limitations require it. // This model is undesirable, but Cocoa limitations require it.
func Go(main func()) error { func Go(main func()) error {

View File

@ -25,7 +25,6 @@ so I don't forget:
- should message box text be selectable on all platforms or only on those that make it the default? - should message box text be selectable on all platforms or only on those that make it the default?
important things: important things:
- ui.Go() should exit when the main() you pass in exits
- because the main event loop is not called if initialization fails, it is presently impossible for MsgBoxError() to work if UI initialization fails; this basically means we cannot allow initializiation to fail on Mac OS X if we want to be able to report UI init failures to the user with one - because the main event loop is not called if initialization fails, it is presently impossible for MsgBoxError() to work if UI initialization fails; this basically means we cannot allow initializiation to fail on Mac OS X if we want to be able to report UI init failures to the user with one
- figure out where to auto-place windows in Cocoa (also window coordinates are still not flipped properly so (0,0) on screen is the bottom-left) - figure out where to auto-place windows in Cocoa (also window coordinates are still not flipped properly so (0,0) on screen is the bottom-left)
- also provide a method to center windoes; Cocoa provides one for us but - also provide a method to center windoes; Cocoa provides one for us but