app: [API] remove Main

All platforms already allow the omission of the call to Main and running
Windows on the main goroutine. This change just gets rid of Main, and
documents the special requirement on Window.Event.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-12-15 18:14:57 -06:00
parent b1f84da679
commit 3879921b80
10 changed files with 13 additions and 61 deletions
+7
View File
@@ -684,6 +684,13 @@ func (w *Window) processEvent(e event.Event) bool {
// Event blocks until an event is received from the window, such as
// [FrameEvent], or until [Invalidate] is called.
//
// Note: if more than one Window is active, at least one must have
// its Event called from the main goroutine that runs the main
// function. This is necessary because some operating system GUI
// implementations require control of the main thread.
// For this reason, it is allowed to call Event even after a
// DestroyEvent has been received.
func (w *Window) Event() event.Event {
w.init()
return w.basic.Event()