summaryrefslogtreecommitdiff
path: root/test/native-filechooser.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-03 08:33:27 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-03-03 08:33:27 +0100
commit2e315e5424d2e54da14ca8f27a4392a3d6be8083 (patch)
tree9dc2aeff59acf242b0225b95de24d733757208f7 /test/native-filechooser.cxx
parent4db9391525ca0e9868b57826c14f0584a8d0b701 (diff)
native-filechooser: add call to fl_register_images() and explain why
Diffstat (limited to 'test/native-filechooser.cxx')
-rw-r--r--test/native-filechooser.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx
index 10194f2ca..0af25845d 100644
--- a/test/native-filechooser.cxx
+++ b/test/native-filechooser.cxx
@@ -26,6 +26,7 @@
#include <FL/Fl_Native_File_Chooser.H>
#include <FL/Fl_Help_View.H>
#include <FL/Fl_Terminal.H>
+#include <FL/Fl_Shared_Image.H>
#define TERMINAL_HEIGHT 120
@@ -80,13 +81,18 @@ void PickDir_CB(Fl_Widget*, void*) {
}
int main(int argc, char **argv) {
- //// For a nicer looking browser under linux, call Fl_File_Icon::load_system_icons();
- //// (If you do this, you'll need to link with fltk_images)
- //// NOTE: If you do not load the system icons, the file chooser will still work, but
- //// no icons will be shown. However, this means you do not need to link in the
- //// fltk_images library, potentially reducing the size of your executable.
- //// Loading the system icons is not required by the OSX or Windows native file choosers.
+ /* For a nicer looking browser under linux/unix, call fl_register_images()
+ (If you do this, you'll need to link with fltk_images).
+ That's required for the preview option of the GTK filechooser.
+ In the unlikely situation where no native filechooser is found on
+ the active Linux system, FLTK reverts to using its own file chooser
+ (Fl_File_Chooser) which looks best if you also call
+ Fl_File_Icon::load_system_icons().
+
+ None of that is useful for the native file chooser under macOS or Windows.
+ */
#if !defined(_WIN32) && !defined(__APPLE__)
+ fl_register_images();
Fl_File_Icon::load_system_icons();
#endif