GTK Error handling..




        Hello all!

        I have a multi-threaded application written in C that I'm a 
bit stumped on.  It's not the 'multithreaded' portion of the code I'm
having issues with.  That seems to be functional.  It's the GTK error 
and warning handling.  

        The application is constantly processing data (syslog).  When a 
rule is 'satisfied',  a thread is spawned which builds a simple GTK 
window (popup) with the information about the 'event.'   So far,  so 
good.  However,  I'm not sure how to handle certain error events.  For
example,   let's say I'm sending 'popups' to a workstation across a
network.   The remote workstation goes off line (the user leaves,  
powers it down, whatever).  My application,  of course,  won't be able 
to send the GTK 'popup'.  I'll likely get the error:

Gtk-WARNING **: cannot open display: 10.10.10.10:0.0

        Here's my problem.   This error/warning causes termination of 
the over all application.  Even though the 'error/warning' gets generated 
from within my 'GTK thread',  it terminates the whole application.  That's 
not good.   Is there any way I could intercept or use a callback with 
the warnings/errors?  That is,  I'd like to log the warnings/errors,  but
I don't want termination of my software due to a GTK/X11 problem.
Basically,  some method to let me deal with the GTK/X11 errors the way I
see fit.   

        I hope this makes sense.  Let me know if you have any questions.

-- 
        Champ Clark III | Softwink, Inc | 800-538-9357 x 101
                     http://www.softwink.com

GPG Key ID: 58A2A58F
Key fingerprint = 7734 2A1C 007D 581E BDF7  6AD5 0F1F 655F 58A2 A58F
If it wasn't for C, we'd be using BASI, PASAL and OBOL.


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