setlocale() added to Fl_File_Chooser demos

This change ensures errors in local language.
See issue #99 for discussion on why this is needed.
This commit is contained in:
Greg Ercolano 2020-07-11 14:46:34 -07:00 committed by Albrecht Schlosser
parent 4471166f59
commit 7426e762a4
2 changed files with 5 additions and 0 deletions

View File

@ -39,6 +39,7 @@
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Simple_Terminal.H>
#include <string.h>
#include <locale.h> // setlocale()..
#define TERMINAL_HEIGHT 120
#define TERMINAL_GREEN "\033[32m"
@ -92,6 +93,7 @@ main(int argc, // I - Number of command-line arguments
// Make the file chooser...
setlocale(LC_ALL, ""); // enable multilanguage errors in file chooser
Fl::scheme(NULL);
Fl_File_Icon::load_system_icons();

View File

@ -23,10 +23,12 @@
#include <FL/Fl_Printer.H>
#include <string.h>
#include <errno.h>
#include <locale.h> // setlocale()..
#include <FL/Fl_File_Chooser.H>
#include <FL/fl_message.H>
#include <FL/Fl_SVG_File_Surface.H>
#include <FL/Fl_Native_File_Chooser.H>
Fl_Box *b;
Fl_Double_Window *w;
Fl_Shared_Image *img;
@ -124,6 +126,7 @@ int arg(int, char **argv, int &i) {
int main(int argc, char **argv) {
int i = 1;
setlocale(LC_ALL, ""); // enable multilanguage errors in file chooser
fl_register_images();
Fl::args(argc,argv,i,arg);