mlabbe / nativefiledialog

A tiny, neat C library that portably invokes native file open and save dialogs.
zlib License
1.78k stars 209 forks source link

Portage from GTK3 to GTK4 #113

Open LouKev opened 1 week ago

LouKev commented 1 week ago

Hi, I'm currently using this library in a GTK3 project. It work well. But the project is transitioning to GTK4 and it cause interference with the GTK3 needed by NFD. I think I already know the answer but I still ask, is there a portage to GTK4 in the pipe ? If no, is it a big deal ? I've never did this, would it cost my soul to try to do it myself ?

btzy commented 6 days ago

I have some half-attempted code for this from more than three years ago (https://github.com/btzy/nativefiledialog-extended/pull/38), but it was abandoned because it was quite non-trivial, GTK4 made it more difficult to just get the file name because it deals with non-local files, and most users of such cross-platform file dialog libraries do not already use some version of GTK.

Why can't you directly use the file dialog API provided by GTK4 if you're already using GTK4? The API is Gtk.FileChooserNative (though it seems deprecated and I'm not sure if the replacement also opens a native dialog).

LouKev commented 3 days ago

@btzy Thanks for your answer, you are right I should implement the GTK4 functions I need. But to be honest there is a lot of resources for GTK3 but not for GTK4... Anyway if I in the end, use your project and improve it, I'll let you know.