Small doc clarification for how to #include this widget.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8093 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Greg Ercolano 2010-12-21 09:48:57 +00:00
parent 51644b78e5
commit 23b3c85ba9
1 changed files with 10 additions and 1 deletions

View File

@ -41,6 +41,15 @@
In cases where there is no native file browser, FLTK's own file browser
is used instead.
To use this widget correctly, use the following include in your code:
\code
#include <FL/Fl_Native_File_Chooser.H>
\endcode
Do not include the other Fl_Native_File_Choser_XXX.H files in your code;
those are platform specific files that will be included automatically
depending on your build platform.
The following example shows how to pick a single file:
\code
// Create and post the local native file chooser
#include <FL/Fl_Native_File_Chooser.H>
@ -50,7 +59,7 @@
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
fnfc.filter("Text\t*.txt\n"
"C Files\t*.{cxx,h,c}");
fnfc.directory("/var/tmp");
fnfc.directory("/var/tmp"); // default directory to use
// Show native chooser
switch ( fnfc.show() ) {
case -1: printf("ERROR: %s\n", fnfc.errmsg()); break; // ERROR