[gtk/fix-initial-demo-selection] gtk-demo: Select the initial demo properly



commit 10bcbae68c3faf8aecbdaca2240a2d28f6159411
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jun 17 12:25:28 2020 -0400

    gtk-demo: Select the initial demo properly
    
    GtkSingleSelection does not give us a notification when
    autoselect kicks in to select the first item. This was
    barely noticeable, since the notebook ends up correctly
    populated anyway, but the window title is not.

 demos/gtk-demo/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 7d5ac5477b..f0a3f78efb 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -1046,8 +1046,9 @@ activate (GApplication *app)
                                        NULL);
   selection = gtk_single_selection_new (G_LIST_MODEL (treemodel));
   g_signal_connect (selection, "notify::selected-item", G_CALLBACK (selection_cb), NULL);
-  gtk_list_view_set_model (GTK_LIST_VIEW (listview),
-                           G_LIST_MODEL (selection));
+  gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
+
+  selection_cb (selection, NULL, NULL);
 
   g_object_unref (builder);
 }


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