ToshioCP / Gtk4-tutorial

GTK 4 tutorial for beginners
https://toshiocp.github.io/Gtk4-tutorial/
548 stars 50 forks source link

GtkFileDialog sorting #55

Open hobthebert opened 1 week ago

hobthebert commented 1 week ago

First of all, I apologize if it is not the way this message might find you. Suddenly this repository became too asceptic to accept messages between users, so, sorry again.

I am trying to make a 'file' listing (like the one of your example) that have folders and files, but they never get sorted the way I want. Using a sorter of mine, I could be able to filter 'folders first' and then files, but they still are not alphabetically sorted. After tweaking with GtkFileDialog internal settings, I noticed it started to have exactly the behavior I want: folders first than files and both ordered alphabetically, but I can't find how this is done in the GtkFileDialog code. Could you give me some tips so I can do it? Thank you very much for your attention.

ToshioCP commented 1 week ago

Thank you for posting a issue. But I didn't get your question well because no code there. I think GtkFileDialog sorting can't be customized in the C source code. If you use GtkColumnView, you can customize the sorting, but you need to write lots of codes from the scratch.

If you want to get advice from experts, GNOME Discourse is the right place. I am not a GTK4 developer.

Further questions with your codes will be welcome if you want.