[prog] Signal handlers & GTK

Sujita Purushothaman sujita at mimos.my
Wed Oct 2 10:28:40 EST 2002


hi,

  I'm trying to write a program that will catch segmentation faults
and display a window saying that the program has terminated.
I have this line in my main function :  signal(SIGSEGV,nocard);

and I have a function nocard like this :

void nocard(int  dummy)
{

    printf("Inside nocard\n");
    gtk_widget_show(window);
    sleep(5);
   exit(1);

}

The problem is the window isn't displayed; I added the sleep after the window
show to make
sure the window is displayed long enough to be seen. I even  tried putting
gtk_init before
gtk_window_show but it still has no effect. The sleep function works well.
What is wrong
here?

Rgds,
Sujita






More information about the Programming mailing list