tree2 = etk_tree_new(); etk_box_append(ETK_BOX(vbox1), ETK_WIDGET(tree2), ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0); col1 = etk_tree_col_new(ETK_TREE(tree2), "Filename", 330, 0.0); etk_tree_col_model_add(col1, etk_tree_model_image_new()); etk_tree_col_model_add(col1, etk_tree_model_text_new()); col2 = etk_tree_col_new(ETK_TREE(tree2), "Size", 50, 0.0); etk_tree_col_model_add(col2, etk_tree_model_text_new()); col3 = etk_tree_col_new(ETK_TREE(tree2), "Location", 50, 0.0); //etk_tree_col_model_add(col3, etk_tree_model_image_new()); etk_tree_col_model_add(col3, etk_tree_model_text_new()); etk_tree_build(ETK_TREE(tree2)); etk_tree_col_sort_set(col1, tree_compare_str_cb, NULL); /* Used to sort the strings column from tree... */ int tree_compare_str_cb(Etk_Tree_Col *col, Etk_Tree_Row *row1, Etk_Tree_Row *row2, void *data) { int c = 0; char *str1, *str2; void *vd; etk_tree_row_fields_get(row1, col, (&vd, &str1, NULL), NULL); etk_tree_row_fields_get(row2, col, (&vd, &str2, NULL), NULL); c = strcmp(str1, str2); if( c < 0 ) return -1; else if( c > 0 ) return 1; else return 0; }