summaryrefslogtreecommitdiff
path: root/src/fl_file_dir.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/fl_file_dir.cxx')
-rw-r--r--src/fl_file_dir.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx
index 432a7f83e..401008e10 100644
--- a/src/fl_file_dir.cxx
+++ b/src/fl_file_dir.cxx
@@ -26,23 +26,34 @@
#include "flstring.h"
#include <FL/filename.H>
#include <FL/Fl_File_Chooser.H>
-#include <FL/Fl_File_Chooser.H>
+#include <FL/fl_ask.H>
+
static Fl_File_Chooser *fc = (Fl_File_Chooser *)0;
static void (*current_callback)(const char*) = 0;
+static const char *current_label = fl_ok;
+// Do a file chooser callback...
static void callback(Fl_File_Chooser *, void*) {
if (current_callback && fc->value())
(*current_callback)(fc->value());
}
+// Set the file chooser callback
void fl_file_chooser_callback(void (*cb)(const char*)) {
current_callback = cb;
}
+// Set the "OK" button label
+void fl_file_chooser_ok_label(const char *l) {
+ if (l) current_label = l;
+ else current_label = fl_ok;
+}
+
+
//
// 'fl_file_chooser()' - Show a file chooser dialog and get a filename.
//
@@ -89,6 +100,7 @@ fl_file_chooser(const char *message, // I - Message in titlebar
fc->value(fname);
}
+ fc->ok_label(current_label);
fc->show();
while (fc->shown())