After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589746 - Embedding a GtkFileChooserWidget in a GtkAssistant
Embedding a GtkFileChooserWidget in a GtkAssistant
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
filechooser-retest-and-triage
Depends on:
Blocks: 702853
 
 
Reported: 2009-07-26 09:14 UTC by Pierre Wieser
Modified: 2015-07-17 01:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pierre Wieser 2009-07-26 09:14:42 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
Comment 1 Matthias Clasen 2015-07-17 01:22:49 UTC
Seems to work now.