mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
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:
parent
513ce6135a
commit
6ce24d82d6
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user