Re: [gtk-list] XError's and GDK



On Sun, 5 Sep 1999, Matthew D Allen wrote:

> 
> I've noticed that there was a function in gdk called gdk_event_handler_set
> () and I was hoping that it could help me, but there isn't an RDP entry
> for it, or documentation in general.
> 
> Would this help me with catching and coping with BadWindow/BadFont and
> other similar Xlib errors?  I'd like to make the application recover from
> them.  As it is now, GDK issues an error message and abort()s the program.
> 
> Is there any documentation on Gdk error handing through xlib?  If
> gdk_event_handler_set() can't help, are there any suggestions on what
> might?

this function is an internal one, used to setup the main gdk/gtk loop.
to catch X errors for certain code portions (once you figured *why* 
you are getting the error and have ensured that there is actually no way
to fix your code and work around that) you should use:

gdk_error_trap_push ();

/* call possibly offensive function here */
gdk_sync(); /* flush the x queue to catch errors now */

if (gdk_error_trap_pop ())
  /* handle error case */;

> 
> TIA
> David
> 

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]