[Glade-users] Newbie: Generated code differ with those in tutorial



Below is the code based on the tutorial on gtk.org:
gint main_window_delete_event(GtkWidget* widget, GdkEvent* event, 
gpointer callback_data)
{
    g_print("main_window_delete_event\n");

    return false;
}

void main_window_destroy(GtkWidget* widget, gpointer callback_data)
{
    g_print("main_window_destroy\n");
    gtk_main_quit();
}

And here is the code generated by glade-2 (2.6.8):
gboolean
on_window1_delete_event                (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{
    gtk_main_quit();
  return FALSE;
}


gboolean
on_window1_destroy_event               (GtkWidget       *widget,
                                        GdkEvent        *event,
                                        gpointer         user_data)
{

  return FALSE;
}

And the code to setup signal:
g_signal_connect(G_OBJECT(window), "destroy", 
G_CALLBACK(main_window_destroy), NULL);

I am very confused. The destroy handlers are not the same in prototype. 
What's the deal?

Does anyone know something like a FAQ on delete and destroy events? I 
don't understand when and in what sequence are these two events are raised.

Great thanks!







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