diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-01-14 01:42:05 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-01-14 01:42:05 +0100 |
| commit | 5c90938aa3aa6dcb6f941e8f07937ae1d8951c17 (patch) | |
| tree | 8682dfc4e8eab895c34e70652a9392e91247f664 /src/Fl_File_Chooser.fl | |
| parent | be1c96b98ac71bd71aeb08066ef22ee57171da4c (diff) | |
#887: Fixes FLTK file chooser not releasing preview image.
...when hidden
Diffstat (limited to 'src/Fl_File_Chooser.fl')
| -rw-r--r-- | src/Fl_File_Chooser.fl | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/Fl_File_Chooser.fl b/src/Fl_File_Chooser.fl index 0d5e7db0f..caa695ce8 100644 --- a/src/Fl_File_Chooser.fl +++ b/src/Fl_File_Chooser.fl @@ -5,7 +5,7 @@ code_name {.cxx} comment {// // Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2021 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -76,7 +76,7 @@ Determines the type of file chooser presented to the user. } decl {void update_preview();} {private local } - Function {Fl_File_Chooser(const char *pathname, const char *pattern, int type_val, const char *title)} {open selected + Function {Fl_File_Chooser(const char *pathname, const char *pattern, int type_val, const char *title)} {open } { code {if (!prefs_) { prefs_ = new Fl_Preferences(Fl_Preferences::CORE_USER, "fltk.org", "filechooser"); @@ -86,10 +86,9 @@ Determines the type of file chooser presented to the user. label {Choose File} callback {fileName->value(""); fileList->deselect(); -Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); -window->hide();} open - private xywh {0 0 490 380} type Double hide resizable - code0 {if (title) window->label(title);} modal +hide();} open selected + private xywh {467 276 490 380} type Double resizable + code0 {if (title) window->label(title);} modal visible } { Fl_Group {} {open private xywh {10 10 470 25} @@ -140,17 +139,17 @@ window->hide();} open Fl_Check_Button previewButton { label Preview callback {preview(previewButton->value());} - xywh {10 275 73 20} down_box DOWN_BOX shortcut 0x80070 value 1 + xywh {10 275 105 20} down_box DOWN_BOX shortcut 0x80070 value 1 code0 {previewButton->label(preview_label);} } Fl_Check_Button showHiddenButton { label {Show hidden files} callback {showHidden(showHiddenButton->value());} - xywh {115 275 165 20} down_box DOWN_BOX + xywh {115 275 140 20} down_box DOWN_BOX code0 {showHiddenButton->label(hidden_label);} } Fl_Box {} { - private xywh {115 275 365 20} resizable + private xywh {255 275 225 20} resizable } } Fl_File_Input fileName { @@ -168,7 +167,7 @@ window->hide();} open } { Fl_Return_Button okButton { label OK - callback {window->hide(); + callback {hide(); // Do any callback that is registered... if (callback_) @@ -181,8 +180,7 @@ if (callback_) label Cancel callback {fileName->value(""); fileList->deselect(); -Fl::remove_timeout((Fl_Timeout_Handler)previewCB, this); -window->hide();} +hide();} private xywh {408 345 72 25} code0 {o->label(fl_cancel);} } @@ -298,10 +296,6 @@ data_ = d;} {} code {showChoice->value(f); showChoiceCB();} {} } - Function {hide()} {return_type void - } { - code {window->hide();} {} - } Function {iconsize(uchar s)} {return_type void } { code {fileList->iconsize(s);} {} @@ -345,6 +339,8 @@ okButton->parent()->init_sizes();} {} } decl {void show();} {public local } + decl {void hide();} {public local + } Function {shown()} {return_type int } { code {return window->shown();} {} |
