First let me say thank you for your reply! :)
However, I don't think that the type of button that calls the file_chooser_dialog makes any difference regarding my problem.
This is the function 'my' button calls when clicked:
static void openDialog( GtkWidget *widget,GtkWidget *window)
dialogOPEN = gtk_file_chooser_dialog_new ("Select a folder", GTK_WINDOW (window),
if (gtk_dialog_run (GTK_DIALOG (dialogOPEN)) == GTK_RESPONSE_ACCEPT)
folder = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER (dialogOPEN));
This pops up the file_choose_dialog and the user can select what he wants.
On 'clicking' OK, "folder" is mapped to the selected path, and "create_view_and_model" is called. Now as far as I can work out, the TreeView-model is getting populated with the correct data, but it is not (re-)connected to the actual view.
(When "folder" is mapped at start-up, the "model" is populated and the view 'shows' its data accordingly)
This is the function that gets called from the file_chooser:
static GtkWidget *create_view_and_model (void)
view = gtk_tree_view_new ();
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),0,"Type",renderer,"text", COL_TYPE,NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),1,"Name",renderer,"text", COL_NAME,NULL);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view),TRUE);
gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (view),FALSE);
gtk_tree_view_columns_autosize (GTK_TREE_VIEW (view));
model = create_and_fill_model ();
gtk_tree_view_set_model (GTK_TREE_VIEW (view), model);
What am I doing wrong?