[gtk/wip/otte/whatever: 14/15] gtk-demo: No selection in the words demo
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/whatever: 14/15] gtk-demo: No selection in the words demo
- Date: Wed, 1 Jul 2020 00:51:31 +0000 (UTC)
commit 6edb8f096f5de0965b432f9ba822017aa47c5076
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jun 30 07:55:15 2020 -0400
gtk-demo: No selection in the words demo
This demo is about filtering, not about selection,
so use a GtkNoSelection.
demos/gtk-demo/listview_words.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/demos/gtk-demo/listview_words.c b/demos/gtk-demo/listview_words.c
index 2384edcbf1..de124b3383 100644
--- a/demos/gtk-demo/listview_words.c
+++ b/demos/gtk-demo/listview_words.c
@@ -157,6 +157,7 @@ do_listview_words (GtkWidget *do_widget)
{
GtkWidget *header, *listview, *sw, *vbox, *search_entry, *open_button;
GtkFilterListModel *filter_model;
+ GtkNoSelection *selection;
GtkStringList *stringlist;
GtkFilter *filter;
GtkExpression *expression;
@@ -211,7 +212,9 @@ do_listview_words (GtkWidget *do_widget)
gtk_builder_list_item_factory_new_from_bytes (NULL,
g_bytes_new_static (factory_text, strlen (factory_text))));
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
- gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (filter_model));
+ selection = gtk_no_selection_new (G_LIST_MODEL (filter_model));
+ gtk_list_view_set_model (GTK_LIST_VIEW (listview), G_LIST_MODEL (selection));
+ g_object_unref (selection);
g_signal_connect (filter_model, "items-changed", G_CALLBACK (update_title_cb), NULL);
g_signal_connect (filter_model, "notify::pending", G_CALLBACK (update_title_cb), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]