diff options
Diffstat (limited to 'src/Fl_File_Chooser.cxx')
| -rw-r--r-- | src/Fl_File_Chooser.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Fl_File_Chooser.cxx b/src/Fl_File_Chooser.cxx index c5288e92a..e5274cb51 100644 --- a/src/Fl_File_Chooser.cxx +++ b/src/Fl_File_Chooser.cxx @@ -27,7 +27,6 @@ #include "../FL/Fl_File_Chooser.H" #include <FL/fl_draw.H> -#include <FL/Fl_Bitmap.H> void Fl_File_Chooser::cb_window_i(Fl_Double_Window*, void*) { fileName->value(""); @@ -60,9 +59,14 @@ void Fl_File_Chooser::cb_newButton(Fl_Button* o, void* v) { ((Fl_File_Chooser*)(o->parent()->parent()->user_data()))->cb_newButton_i(o,v); } +#include <FL/Fl_Bitmap.H> static const unsigned char idata_new[] = {0,0,120,0,132,0,2,1,1,254,1,128,49,128,49,128,253,128,253,128,49,128,49, 128,1,128,1,128,255,255,0,0}; +static Fl_Image *image_new() { + static Fl_Image *image = new Fl_Bitmap(idata_new, 16, 16); + return image; +} void Fl_File_Chooser::cb__i(Fl_Tile*, void*) { update_preview(); @@ -163,10 +167,8 @@ void Fl_File_Chooser::cb_favOkButton(Fl_Return_Button* o, void* v) { } Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char *title) { - static Fl_Bitmap *image_new = NULL; - if (!image_new) { + if (!prefs_) { prefs_ = new Fl_Preferences(Fl_Preferences::USER, "fltk.org", "filechooser"); - image_new = new Fl_Bitmap(idata_new, 16, 16); } Fl_Group *prev_current = Fl_Group::current(); { window = new Fl_Double_Window(490, 380, "Choose File"); @@ -186,7 +188,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char favoritesButton->label(favorites_label); } // Fl_Menu_Button* favoritesButton { Fl_Button* o = newButton = new Fl_Button(455, 10, 25, 25); - newButton->image(image_new); + newButton->image( image_new() ); newButton->labelsize(8); newButton->callback((Fl_Callback*)cb_newButton); o->tooltip(new_directory_tooltip); |
