mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user