From a2629c2bbf19e2e904d6d814ae725ccd697f485f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 14 Aug 2014 09:53:29 -0400 Subject: [PATCH] Wrote the documentation for Go(). Also more TODOs. --- redo/doc.go | 1 + redo/future | 4 +++- redo/uitask.go | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/redo/doc.go b/redo/doc.go index d204f64..be96265 100644 --- a/redo/doc.go +++ b/redo/doc.go @@ -7,5 +7,6 @@ notes: - default behavior of event handlers is to do nothing - default behavior of event handlers that return bool is to do nothing but return false - passing nil to an event handler set function restores default behavior +- only functions safe for calling outside Do() are Go(), Do(), and Stop() */ package ui diff --git a/redo/future b/redo/future index 727720b..71c56b9 100644 --- a/redo/future +++ b/redo/future @@ -53,4 +53,6 @@ windows mac os x - applicationShouldTerminate: not handled gtk+, mac os x - - default buttons, escape + - Area: default buttons, escape +all + - make spaced settable somehow diff --git a/redo/uitask.go b/redo/uitask.go index 12bd0f3..4460ab2 100644 --- a/redo/uitask.go +++ b/redo/uitask.go @@ -8,8 +8,10 @@ import ( "unsafe" ) -// Go initializes package ui. -// TODO write this bit +// Go initializes and runs package ui. +// It returns a non-nil error if initialization fails. +// Otherwise, it will run the event loop and not return until Stop is called. +// Due to platform-specific issues, it must be called from the main OS thread; in general, do not call Go() from anywhere except main() (including any goroutines). func Go() error { runtime.LockOSThread() if err := uiinit(); err != nil {