From b4eaa6f316553ae78824aea7d2b9e83e398bdfb9 Mon Sep 17 00:00:00 2001 From: neox Date: Mon, 12 Feb 2024 17:54:44 +0100 Subject: [PATCH] Quite working tree --- gtk_treeview_example | Bin 28576 -> 28560 bytes main.c | 68 +++++++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/gtk_treeview_example b/gtk_treeview_example index b4318999b642402adc48297bd02fac290be18cb5..3d286131fbd503d60339dad56128774f46cc01e4 100755 GIT binary patch delta 9471 zcmZX42|SeF_y3H2-*>VLWmh5F*r!k=LL_^3iEJ@;*)n=4ZMIMeSyHwvDYAu1$SyKj zvi2dA|9zg}^Z$JN-IsgLbKd9Nd(S!dJkQ*jN6t7J5B|8AdxbG5xDhD|g-?@wM4icw zV5rQrAzA7Nv_#8 zX(Egg1Y8JoX3)7nhZ_s%5}=EKP69gISV0#6oelIupi_emH%`#`kt-BR3~ z&a)>U1Y8(&QP9O<75$##FyL@(bf8N?_GCWHG~kLCbSBW@b^!WLCV=LH%1Kxy$bk&I zBn3JebPCW>AmDvBVLUf)%?TLuq1_-MN>0d^oC}?cT;-5+L1mO&P%pV0dI7pj&WU~r zp(!{aISMW`4{U+fgJm=+g5oJIqLUE02eBm}*ER?>My#`u>uN-sf*?ncbtWje&~mU2 zVxr=Pw5SZwU5Mo!D3>Y_&5v9MLh{tI=ul)7HB4#Kf$MPQmxVBu(bP@oN(b5&a_9^* z3#7r!1!0&e&?L}#W^s@&Gzd2u1ihc2=V`Y<9!OCsdsqOE8`vHaR3`L<`7ruWWk2&v z60{VQ!p6zHzg1uz6qP9kW++O~1)x`KoKQU*9X;27P$6g$pbG$%_zx-q9bo5#_}J;_ zmH&f^LB;?z0x0%Bs5le`&}#s-{0}M#m9UFcF0ixFK+EiBD+GH5JG;B>EijCYUSPr|gl!V00fbF>jZMkCbSV8{;!eU|1naBsyF+6Ptv>CbTvxf}0YFjgSO=5Ic&K1HKGm69Rg%N#wy`qp=CVoi@E?I7q+= z2v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EF%8tOJ|!{Q3LK~#v>BwoY1AEx7VXSheYzQg(>#N8Lqusp}5S$R{fY*Q(2m^vgei> z_A|R}YhB&I1=D^X!8@IDVR_~X=%-8tHpbp=d?tp~(qDadRI6S+PL9QO4hHfkoBQ%R z$aPkU^LoADa?D7@IclzVIb_kFzl#jr-yp_LE5?Oqd|c-q?;NQKmCJKwaJ86f`A04x zkaWk(L&#F@rfJ=(W?NZ~@|uW)a=Uyq{Vd(`^&p#nGP&7M`5)(G7Ya%;GbE=(x>&~* z6&9%QGC%o>_^dP@^p(Hu6R^vgt8LO-y_~vfa<+Z&+4W7b$vMSE&wip~4I?wSVU9bd z*sD|t0>l|xY|Bn1t&V*?u&aUIy^J`P-2w#s?E?_KWc}Z^EJLCLfX%WUvLU{ zU<-rf13%DnKJKMWfZW_yaj4&=rs0y0I-FKD`{Mmh$lf@%Kz&%&T!A7$2D{jt(9Fcf zy4sP+&}CkP%3>Lc8$Zq(kvrm^(eg=`F-#$Xo@P5@_2tnoJ@Ohasxz-vwLhc1%l3(e ztH;GXx5k%?D@dBeSx3=fPxqG1oQ~}1q~=RP_erd zMf5%z4b8aAQM}xjUP7WCa)%FI`;YC90RILAdRzjZuPk{;{rUK3jDOEuFogD$qA(Lz zC5UE_ho=tG23qprfx0~DC=cHE+n}LY&l40l^qv~7RMblciS&m8yrn1(-fa6rPrcchild; - } - else if (strcmp(string, "Child 2") == NULL) { - cur = root->child->next; - } else { - cur = NULL; + parent = root; + while (cur) { + if (strcmp(string, cur->text) == NULL) { + res = cur; + break; + } + + cur = cur->next; + if (cur == NULL) { + cur = parent->child; + parent = cur; + } } printf("[create_model_func] here is %s item\n", string); @@ -128,34 +133,24 @@ void on_expander_toggled(GtkExpander *expander, gpointer user_data) { // Update your model here based on the new state } -void setup_factory (GtkListItemFactory *factory, GtkListItem *list_item, gpointer user_data) +void on_setup_factory (GtkListItemFactory *factory, GtkListItem *list_item, gpointer user_data) { GtkWidget* expander = gtk_expander_new (NULL); gtk_list_item_set_child (list_item, expander); - printf("[setup_factory] here is an expander\n"); + printf("[on_setup_factory] here is an expander\n"); } -void bind_factory (GtkListItemFactory *factory, GtkListItem *list_item, gpointer user_data) +void on_bind_factory (GtkListItemFactory *factory, GtkListItem *list_item, gpointer user_data) { GObject *item; const gchar *text; GtkTreeListRow *row = gtk_list_item_get_item(list_item); if (row != NULL) { - gboolean is_expanded = gtk_tree_list_row_get_expanded(row); text = gtk_string_object_get_string(GTK_STRING_OBJECT(gtk_tree_list_row_get_item(row))); GtkWidget *expander = gtk_list_item_get_child(list_item); gtk_expander_set_label(GTK_EXPANDER(expander), text); - - //gtk_tree_list_row_set_expanded(row, !is_expanded); - - if (gtk_tree_list_row_get_children(row)) { - printf("[bind_factory] here is %s content (childs)\n", text); - } else { - printf("[bind_factory] here is %s content (no childs)\n", text); - } - // Disconnect previous signal handlers to avoid stacking them g_signal_handlers_disconnect_by_func(expander, G_CALLBACK(on_expander_toggled), row); @@ -163,10 +158,10 @@ void bind_factory (GtkListItemFactory *factory, GtkListItem *list_item, gpointer g_signal_connect(expander, "activate", G_CALLBACK(on_expander_toggled), row); gtk_widget_set_margin_start(expander, gtk_tree_list_row_get_depth(row)*20); - - //g_object_unref(row); // Decrease the reference count when done + gboolean is_expanded = gtk_tree_list_row_get_expanded(row); + //gtk_tree_list_row_set_expanded(row, !is_expanded); } else { - printf("[bind_factory] here is NON %s content\n", text); + printf("[on_bind_factory] here is NON %s content\n", text); } } @@ -182,8 +177,8 @@ void app_activate (GApplication *app, gpointer user_data) // Create and setup the list view and item factory GtkListItemFactory *factory = gtk_signal_list_item_factory_new (); - g_signal_connect (factory, "setup", G_CALLBACK(setup_factory), NULL); - g_signal_connect (factory, "bind", G_CALLBACK(bind_factory), NULL); + g_signal_connect (factory, "setup", G_CALLBACK(on_setup_factory), NULL); + g_signal_connect (factory, "bind", G_CALLBACK(on_bind_factory), NULL); // Create a GtkTreeListModel GtkTreeListModel *tree_model = gtk_tree_list_model_new( @@ -192,7 +187,7 @@ void app_activate (GApplication *app, gpointer user_data) FALSE, // autoexpand (GtkTreeListModelCreateModelFunc)create_model_func, NULL, - NULL //(GDestroyNotify)free_tree_node + (GDestroyNotify)g_object_unref //(GDestroyNotify)free_tree_node ); GtkNoSelection *selection_model = gtk_no_selection_new ( @@ -209,8 +204,19 @@ int main (int argc, char **argv) { // Create a simple tree structure root = create_tree_node("Root"); - add_child_node(root, create_tree_node("Child 1")); - add_child_node(root, create_tree_node("Child 2")); + struct TreeNode_t *A = create_tree_node("A"); + struct TreeNode_t *B = create_tree_node("B"); + struct TreeNode_t *C = create_tree_node("C"); + struct TreeNode_t *D = create_tree_node("D"); + struct TreeNode_t *E = create_tree_node("E"); + struct TreeNode_t *F = create_tree_node("F"); + struct TreeNode_t *G = create_tree_node("G"); + add_child_node(root, A); + add_child_node(A, B); + add_child_node(B, C); + add_child_node(C, D); + add_child_node(E, F); + add_child_node(F, G); GtkApplication *app = gtk_application_new("org.gtk.example", G_APPLICATION_FLAGS_NONE); g_signal_connect(app, "activate", G_CALLBACK(app_activate), NULL);