From 0dbe15a211de42302657c57a5ce486dc1c7caba0 Mon Sep 17 00:00:00 2001 From: rods Date: Thu, 9 Jul 1998 19:03:30 +0000 Subject: [PATCH] Added error callback --- widget/src/motif/nsToolkit.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/widget/src/motif/nsToolkit.cpp b/widget/src/motif/nsToolkit.cpp index 912e5b7fd62..aadac5297ec 100644 --- a/widget/src/motif/nsToolkit.cpp +++ b/widget/src/motif/nsToolkit.cpp @@ -28,6 +28,23 @@ void RunPump(void* arg) { } +//------------------------------------------------------------------------- +// +// constructor +// +//------------------------------------------------------------------------- +int nsToolkitErrorHandler (Display * mydisplay, XErrorEvent * myerr) +{ + char msg[80] ; + + XGetErrorText (mydisplay, myerr->error_code, msg, 80) ; + fprintf (stderr, "-------------------------------------\n"); + fprintf (stderr, "Error code %s\n", msg) ; + fprintf (stderr, "-------------------------------------\n"); + //exit() ; +} + + //------------------------------------------------------------------------- // // constructor @@ -35,6 +52,7 @@ void RunPump(void* arg) //------------------------------------------------------------------------- nsToolkit::nsToolkit() { + XSetErrorHandler (nsToolkitErrorHandler) ; NS_INIT_REFCNT(); }