About Gtk Dialog box Behavior

gtk

About Gtk Dialog box Behavior…

I am using GtkBuilder +Glade to display a top level window and dialogs in it…

builder = gtk_builder_new();
gtk_builder_add_from_file( builder, "test.glade", NULL );
windowPtr = GTK_WIDGET( gtk_builder_get_object( m_builder, "window_main"));

on clicking on button i am opening one dialog box which is in other glade file….
after closing the dialog box control gets return to main window….

but when i click again on button to open dialog box.. it opens the dialog box but dialog box does not show any child widgets in it (it is just a empty window).. why this is happening?

I am not handling close event on dialog!

Best Answer

In glade, set the callback for "delete-event" of your GtkDialog to gtk_widget_hide_on_delete. This will then hide your dialog instead of destroying it.

Also, you will need to add this line to your program:
gtk_builder_signals_connect( m_builder, NULL )

Related Topic