gtk-demo: Don't create 2 main windows

Loading a builder file with a window leaves a ghost behind, since
windows need to be explicitly destroyed. Avoid that by using
gtk_builder_add_objects_from_resource.
This commit is contained in:
Matthias Clasen 2014-09-25 23:57:34 -04:00
parent 513ce6135a
commit 6ce24d82d6

View File

@ -916,9 +916,10 @@ startup (GApplication *app)
{
GtkBuilder *builder;
GMenuModel *appmenu;
gchar *ids[] = { "appmenu", NULL };
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder, "/ui/main.ui", NULL);
gtk_builder_add_objects_from_resource (builder, "/ui/main.ui", ids, NULL);
appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu");