[gtk: 2/2] Merge branch 'gtk-demo-run-no-main-window' into 'master'



commit fe73730d21472194741ebdf7775c4b183c498106
Merge: b814970bdd 0bd039a524
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 1 12:26:15 2020 +0000

    Merge branch 'gtk-demo-run-no-main-window' into 'master'
    
    gtk-demo: Don't show main window if --run is passed in
    
    See merge request GNOME/gtk!1979

 demos/gtk-demo/main.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --cc demos/gtk-demo/main.c
index 8052f2f96b,3ff4e22b91..28a05167d5
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@@ -1039,22 -1019,18 +1039,20 @@@ activate (GApplication *app
  
    load_file (gtk_demos[0].name, gtk_demos[0].filename);
  
 -  populate_model (model);
 -
 -  g_signal_connect (treeview, "row-activated", G_CALLBACK (row_activated_cb), model);
 -
 -  widget = (GtkWidget *)gtk_builder_get_object (builder, "treeview-selection");
 -  g_signal_connect (widget, "changed", G_CALLBACK (selection_cb), model);
 -
 -  gtk_tree_model_get_iter_first (gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)), &iter);
 -  gtk_tree_selection_select_iter (GTK_TREE_SELECTION (widget), &iter);
 +  listmodel = create_demo_model ();
 +  treemodel = gtk_tree_list_model_new (FALSE,
 +                                       G_LIST_MODEL (listmodel),
 +                                       FALSE,
 +                                       get_child_model,
 +                                       NULL,
 +                                       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_tree_view_collapse_all (GTK_TREE_VIEW (treeview));
 +  award ("demo-start");
  
-   gtk_widget_show (GTK_WIDGET (window));
- 
    g_object_unref (builder);
  }
  


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