From f636a6ce6d28bd8d7484c7e82d28c1e0777023c1 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 24 Jul 2001 23:50:34 +0000 Subject: [PATCH] - added guiErrorMessage (sends both to log and dialog, if GUI active) --- src/GUI/gui.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/GUI/gui.cxx b/src/GUI/gui.cxx index 059b813b2..853b9516d 100644 --- a/src/GUI/gui.cxx +++ b/src/GUI/gui.cxx @@ -153,6 +153,30 @@ void mkDialog (const char *txt) FG_PUSH_PUI_DIALOG( dialogBox ); } +// Message Box to report an error. +void guiErrorMessage (const char *txt) +{ + SG_LOG(SG_GENERAL, SG_ALERT, txt); + if (dialogBox != 0) + mkDialog(txt); +} + +// Message Box to report a throwable (usually an exception). +void guiErrorMessage (const char *txt, const sg_throwable &throwable) +{ + string msg = txt; + msg += '\n'; + msg += throwable.getFormattedMessage(); + if (throwable.getOrigin() != "") { + msg += "\n (reported by "; + msg += throwable.getOrigin(); + msg += ')'; + } + SG_LOG(SG_GENERAL, SG_ALERT, msg); + if (dialogBox != 0) + mkDialog(msg.c_str()); +} + // Toggle the Menu and Mouse display state void guiToggleMenu(void) { -- 2.39.5