ui/app: introduce DestroyEvent for ending the event loop

Replace the StageDead stage with DestroyEvent dedicated to ending
the event loop and, for premature window closes, the error.

Drop the error return from NewWindow; any errors in window creation
will appear as an immediate DestroyEvent with its Err field set.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-13 11:41:12 +02:00
parent 8e307b40a6
commit 59e92e8233
6 changed files with 51 additions and 30 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ func getConfig() Config {
func gio_onTerminate(view C.CFTypeRef) {
w := views[view]
delete(views, view)
w.setStage(StageDead)
w.w.event(DestroyEvent{})
}
//export gio_onHide