Crashing closing windows



I am programming GTK-1.0 now. I am using olvwm. The alt-q event used to
send a delete_event to the window, where fvwm used to send a destroy. So I
used to add a call to gtk_widget_destroyt_destroy on the delete event.
That worked.

Now with 1.0 I no longer have to do this, the window is destroyed on
ALT-Q. However, if I create a button on the form and press that to call
destroy in the window object, it segfaults the entire application.

Whenb I do a stack trace in xxgdb, I have no stack. It's just gone. The
signal setup is this:

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW (window), "Day display (needs date)");
    gtk_signal_connect (GTK_OBJECT (window), "destroy",
                    GTK_SIGNAL_FUNC (gtk_widget_destroyed), &window);
    gtk_container_border_width (GTK_CONTAINER (window), 0);
    gtk_widget_realize (window);
    
[SNIP]

    button = gtk_button_new_with_label ("Close");
    gtk_box_pack_start (GTK_BOX (innervertbox), button, FALSE, TRUE, 0);
    gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
                    GTK_SIGNAL_FUNC (gtk_widget_destroy),
                    GTK_OBJECT (window));
    gtk_widget_show(button);

Some of my forms work, some don't. The ones that work seem to be the ones
where the button is the l;ast object created on the form, but this isn't
always the case. The ones which crash and the ones that don't are
consistent with recompiles and copies and pastes of the signal  setup from
working code to non-working code.

If anyone could help me with this, I would appreciate it. Pressing ALT-Q
does not crash it, just pressing the button does.

Thankyou.

--
S.
GM/CS/MU -d+ H+>++ s+: !g p2 au0 !a w+++ v-(---) C++++$ UL++++$ UB+
US++ UI+++$ P+>++++ L++++$ 3+ E--- N+ K !W(-----) M+(-) !V -po+ Y+ t+
5++ !j !R G' !tv b+++ D++ B--- e+ u+* h++ f? r-- n---- y?




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