Hi Ken
On 2013-12-11 11:06, Ken Bass <daytoo...@gmail.com> wrote:
/* Create new GtkBuilder object */
builder = gtk_builder_new();
if( ! gtk_builder_add_from_file( builder, UI_FILE, &error ) )
{
g_warning( "%s", error->message );
g_free( error );
return( 1 );
}
/* Connect signals */
gtk_builder_connect_signals( builder, NULL );
/* Destroy builder, since we don't need it anymore */
g_object_unref( G_OBJECT( builder ) );
/* Show window. All other widgets are automatically shown by GtkBuilder
*/
gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(builder,
"main_window"));)
It is probably unrelated, but note that you call g_object_unref() on
builder, and then use it again later when you call
gtk_builder_get_object(). You should move the g_object_unref() call to
after the last call that uses builder.
Also, you should use g_error_free() on error, rather than g_free().
--
http://amigadave.com/
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list