From 16e561c1e37e08131bc8f9705b97f4b5c38ce226 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 15 Feb 2014 16:27:07 -0500 Subject: Added message boxes and adjusted init() accordingly to display one on failure. --- init.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'init.go') diff --git a/init.go b/init.go index 799add6..c3c0aea 100644 --- a/init.go +++ b/init.go @@ -2,16 +2,20 @@ //package ui package main -// TODO this will be system-defined -func initpanic(err error) { - panic("failure during init: " + err.Error()) -} +import ( + "os" +) func init() { initDone := make(chan error) go ui(initDone) err := <-initDone if err != nil { - initpanic(err) + // TODO provide copying instructions? will need to be system-specific + MsgBoxError("UI Library Init Failure", + "A failure occured during UI library initialization:\n%v\n" + + "Please report this to the application developer or on http://github.com/andlabs/ui.", + err) + os.Exit(1) } } -- cgit v1.2.3