diff --git a/src/ui/tree.c b/src/ui/tree.c index 5185f88..a4a71f8 100644 --- a/src/ui/tree.c +++ b/src/ui/tree.c @@ -71,8 +71,35 @@ create_and_fill_model (void) void Hello(void) { GtkWidget *view; // = gtk_tree_view_new (); - printf("Hello, from src/ui/tree.c ! -------------------------\n"); - return NULL; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), + -1, + "Name", + renderer, + "text", COL_NAME, + NULL); + + /* --- Column #2 --- */ + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), + -1, + "Age", + renderer, + "text", COL_AGE, + NULL); + + GtkTreeModel *model = create_and_fill_model (); + + + printf(" Hello, from src/ui/tree.c ! ----------------------------------------------------------\n\ + Remplacer la ligne 73 par : GtkWidget *view = gtk_tree_view_new ();\n\ + provoque une erreur de segmentation.\n\ + La méthode suivie est d'insèrer progressivement des fragments de l'exemple suivant :\n\ + For the impatient, here is a small tree view ‘Hello World’ program:\n\ + https :// docs.gtk.org/gtk3/treeview-tutorial.html \n\ + > Pourquoi cette erreur de segmentation ? <\n"); + return NULL;q }