From 2e315e5424d2e54da14ca8f27a4392a3d6be8083 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sun, 3 Mar 2024 08:33:27 +0100 Subject: native-filechooser: add call to fl_register_images() and explain why --- test/native-filechooser.cxx | 18 ++++++++++++------ 1 file 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 #include #include +#include #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 -- cgit v1.2.3