summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-04-10 22:37:04 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-04-10 22:37:04 +0000
commit7e79bfa61109a0ea90b7aad978700fc2e240f94e (patch)
tree40e7949be1c3d2b389fc8075b417bbb8c0694eb9
parentc279f087a13ae80c6a923dd24644e253a380c669 (diff)
Check for proper directory handling with FL_Enter (STR #787)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4267 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_File_Chooser2.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index c9264d7c4..c55012734 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -533,14 +533,16 @@ Fl_File_Chooser::fileNameCB()
#endif /* WIN32 || __EMX__ */
directory(pathname);
} else if ((type_ & CREATE) || access(pathname, 0) == 0) {
- // Update the preview box...
- update_preview();
+ if (!fl_filename_isdir(pathname) || (type_ & DIRECTORY)) {
+ // Update the preview box...
+ update_preview();
- // Do any callback that is registered...
- if (callback_) (*callback_)(this, data_);
+ // Do any callback that is registered...
+ if (callback_) (*callback_)(this, data_);
- // Hide the window to signal things are done...
- window->hide();
+ // Hide the window to signal things are done...
+ window->hide();
+ }
} else {
// File doesn't exist, so beep at and alert the user...
fl_alert(existing_file_label);