From aa406667da347dc0ec346bd425e146f2f6a2e340 Mon Sep 17 00:00:00 2001 From: sqweek Date: Sat, 2 Oct 2021 14:52:04 +0800 Subject: [PATCH] example/wde: report window creation errors (instead of silently hanging) --- example/wde/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/example/wde/main.go b/example/wde/main.go index a040fbe..d76f69f 100644 --- a/example/wde/main.go +++ b/example/wde/main.go @@ -60,7 +60,12 @@ func events(events <-chan interface{}) { func main() { go func() { - w, _ := wde.NewWindow(300, 300) + w, err := wde.NewWindow(300, 300) + if err != nil { + fmt.Println("Error creating window:", err) + wde.Stop() + return + } loadR = image.Rect(0, 0, 300, 150) saveR = image.Rect(0, 150, 300, 300) w.Show()