GNOME Bugzilla – Bug 589746
Embedding a GtkFileChooserWidget in a GtkAssistant
Last modified: 2015-07-17 01:22:49 UTC
Hi, Problem: - when using GtkBuilder - embedding a GtkFileChooserWidget in one of the content pages of a GtkAssistant When the assistant is ran for the second times, the GtkfileChooserWidget doesn't display at all. Below a sample code which reproduces the problem : enum { ASSIST_PAGE_INTRO = 0, ASSIST_PAGE_FILES_SELECTION, ASSIST_PAGE_DONE }; static void on_cancel( GtkAssistant *assistant, gpointer user_data ) { gtk_widget_hide_all( GTK_WIDGET( assistant )); gtk_main_quit(); } /** * Run the assistant. */ void nact_assist_import_run( void ) { static GtkBuilder *xml = NULL; if( !xml ){ xml = gtk_builder_new(); gtk_builder_add_from_file( xml, GLADEDIR "/nautilus-actions-config.ui", NULL ); } GtkAssistant *assistant = GTK_ASSISTANT( gtk_builder_get_object( xml, "ImportAssistant" )); GtkWidget *intro = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_INTRO ); gtk_assistant_set_page_complete( assistant, intro, TRUE ); GtkWidget *selector = gtk_assistant_get_nth_page( assistant, ASSIST_PAGE_INTRO ); gtk_assistant_set_page_complete( assistant, selector, TRUE ); g_signal_connect( G_OBJECT( assistant ), "cancel", G_CALLBACK( on_cancel ), NULL ); gtk_widget_show_all( GTK_WIDGET( assistant )); gtk_main(); } Note that if I initialize a new GtkBuilder _each time_ I run the assistant, then all works fine. But I feel this work-around as a waste of resources... Note also that embedding other widgets (combobox or so) is fine, and doesn't show the same problem. Regards Pierre
Seems to work now.