DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2904
Version: 1.3-feature


No, perhaps you misunderstand: it is not necessary to copy/paste anything
from gtk.

What we'd have to do would be something like this: (note that this is
essentially what the Win32 and OSX cases do...)

- We write a (probably C language) wrapper for launching
GtkFileChooserDialog programmatically from within fltk, and passing in the
various options that fltk knows and converting them to the
GtkFileChooserDialog equivalents. (Turns out this might be quite
straightforward, I had a brief look at the GTK+ docs last night and it
seems do-able!)

- At runtime, if someone wants a file-chooser, we use dlopen (or
something...) to check for the presence of the required gtk/glib .so files
and load them if available, then use our GtkFileChooserDialog wrapper.

- if the gtk .so are not available, we use our stock fltk file-chooser
instead, as we do at present.

- Of course, on subsequent calls to the file-chooser we don't have to
re-check for gtk, we already know the answer...

As I say, this is very similar to what we do on other platforms, and only
one file will contain any gtk+ code, so we are not importing large chunks
of another toolkit or anything, just using their public API and calling
the existing libs.

Also, by loading the gtk libs via dlopen that ensures we do not need to
link against those libs if we are not using them.

Well, something like that, anyway.

FWIW, I wrote a simple wrapper to test opening GtkFileChooserDialog in
"Open File" and "Save As" mode, and it seemed to work and wasn't all that
much code, so I think this can be made to function.

Though creating the code to map all the fltk options onto GTK options is
going to be non-trivial!

Also, and this may be relevant, the GtkFileChooserDialog API seems to be
more or less identical in gtk+2 and gtk+3 so there's a fair chance we
could write one version of our wrapper function that would work in either
case, regardless of what version of GTK the end-user had installed...
Maybe...


Link: http://www.fltk.org/str.php?L2904
Version: 1.3-feature

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to