From ca2a4e332d1dd93034deee3b3c0a68f3aef42af4 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sat, 13 Jan 2024 15:55:56 +0100 Subject: [PATCH] =?UTF-8?q?WIP:=20Un=20tas=20de=20briques=20n'est=20pas=20?= =?UTF-8?q?une=20maison...=20=20(H.=20Poincarr=C3=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/tree.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/ui/tree.c b/src/ui/tree.c index ce13db0..73f0605 100644 --- a/src/ui/tree.c +++ b/src/ui/tree.c @@ -60,18 +60,18 @@ static TreeItem R[] = {{"A", A}, {"B", B}, {"C", C}, {NULL}}; static TreeItem O[] = {{"ROOT", R}, {NULL}}; // Artefact added for symmetry -/* static void */ -/* bind_listitem_cb_complex (GtkListItemFactory *factory, */ -/* GtkListItem *list_item) */ -/* { */ -/* GtkWidget *label; */ -/* TreeItem *obj; */ +static void +bind_listitem_cb_complex (GtkListItemFactory *factory, + GtkListItem *list_item) +{ + GtkWidget *label; + TreeItem *obj; -/* label = gtk_list_item_get_child (list_item); */ -/* obj = gtk_list_item_get_item (list_item); */ -/* gtk_label_set_label (GTK_LABEL (label), */ -/* my_object_get_string (obj)); */ -/* } */ + label = gtk_list_item_get_child (list_item); + obj = gtk_list_item_get_item (list_item); + gtk_label_set_label (GTK_LABEL (label), + my_object_get_string (obj)); +} static GtkWidget *my_tree_view; static GListModel *my_Glist_model = NULL; @@ -248,12 +248,10 @@ user_function (GListModel *list, // https://docs.gtk.org/gtk4/class.ListItemFactory.html <<< // https://www.typeerror.org/docs/gtk~4.0/gtksignallistitemfactory // https://developer-old.gnome.org/gtk4/stable/GtkListView.html <<< copy that ! - // https://docs.gtk.org/gtk4/class.ListItem.html // https://docs.gtk.org/gtk4/ctor.TreeListModel.new.html *** // https://blog.gtk.org/2020/06/08/more-on-lists-in-gtk-4/ *** // https://gitlab.gnome.org/GNOME/gtk/-/blob/main/demos/gtk-demo/listview_settings.c GtkBuilder *builder; (line 216) // https://discourse.gnome.org/t/how-can-i-get-the-expanded-collapsed-items-in-the-new-gtktreelistmodel-implementation/16824 - // https://developer-old.gnome.org/gtk4/stable/GtkSignalListItemFactory.html