gnome_dns_abort unrealize my widget



 When I add a gtkwidget to a gnomeapp... it is done
properly the first time. Then, when the user clicks
a menu item, I change the contents, with no problems..

but If I restore the old contents (a logo, but
I tryed with a gtklabel), after the expose and the
draw event, the widget receives an "unrealize" signal,
so, I can see it for just few miliseconds

 Looking and tracing the code, I discovered that
inside gnome_dns_abort (I dont call it :?), the
function gtk_widget_unparent is called...

 Inside this function, the line:

 if ( GTK_WIDGET_REALIZED (widget) && !GTK_WIDGET_IN_REPARENT (widget))
	gtk_widget_unrealize (widget);

 is evaluated as true

 GTK_WIDGET_REALIZE is true, because the widget is visible at this
moment

 but... what is the meaning of GTK_WIDGET_IN_REPARENT?

 and.. why do I receive this signal from gtk?

 My code to restore the old logo:

	/* flush previus events */

	while ( gtk_events_pending() ) gtk_main_iteration ();

	/* remove the old contents. The previus logo ref is 1, so, I dont loose
it */
	if ( GNOME_APP(appGlobal)->contents )
	{
		gtk_container_remove (	GTK_CONTAINER(
GNOME_APP(appGlobal)->contents->parent ),
					GNOME_APP(appGlobal)->contents );
	}

	gnome_app_set_contents (GNOME_APP(appGlobal),  logo);
	gtk_widget_show_all ( GTK_WIDGET(appGlobal) );

	return(TRUE);

 The "unrealize" event is emmited after this code...
so, this code seems to work well, and it's done with
no problem the first time.

 Any suggestion?

 Thanks!

-- 
signed
          derethor of centolos




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