void fl_message(const char *);
Displays a message in a pop-up box with an "OK" button, waits for
the user to hit the button. The message will wrap to fit the window,
or may be many lines by putting \n characters into it. Return is a
shortcut for the OK button.
void fl_alert(const char *);
Same as fl_message except for the "!" symbol.
int fl_ask(const char *);
Displays a message in a pop-up box with an "Yes" and "No" button,
waits for the user to hit the button. The message may be many lines
by putting \n characters into it. The return value is 1 if the user
hits Yes, 0 if they pick No. Return is a shortcut for Yes, Escape is
a shortcut for No.
int fl_choice(const char *q,const char *b0,const char
*b1,const char *b2);
Shows the message with three buttons below it marked with the strings
b0, b1, and b2. Returns 0, 1, or 2 depending on which button is hit.
Escape is a shortcut for button 0, and Return is a shortcut for button
1. Notice the "misordered" position of the buttons. You can hide
buttons by passing NULL as their labels.
const char *fl_input(const char *label, const char *deflt = 0);
Pops up a window displaying a string, lets the user edit it, and
return the new value. The cancel button returns NULL. The
returned pointer is only valid until the next time fl_input() is
called.
const char *fl_password(const char *label, const char *deflt = 0);
Same as fl_input() except an Fl_Secret_Input field is used.
void fl_message_font(Fl_Font fontid, uchar size);
Fl_Widget *fl_message_icon();
Fltk provides a "tab completion" file chooser that makes it easy to choose files from large directories. This file chooser has several unique features, the major one being that the Tab key completes filenames like it does in Emacs or tcsh, and the list always shows all possible completions.
char *fl_file_chooser(const char *message,const char
*pattern,const char *fname);
Pops up the file chooser, waits for the user to pick a file or
Cancel, and then returns a pointer to that filename or null if Cancel
is chosen.
message is a string used to title the window.
pattern is used to limit the files listed in a directory to those matching the pattern. This matching is done by filename_match(). Use null to show all files.
fname is a default filename to fill in the chooser with. If this is null then the last filename that was choosen is used (unless that had a different pattern, in which case just the last directory with no name is used). The first time the file chooser is called this defaults to a blank string.
The returned value points at a static buffer that is only good until the next time fl_file_chooser() is called.
void fl_file_chooser_callback(void (*cb)(const char
*));
int filename_list(const char *d, dirent ***list);
// here is how to free the allocated space:
for (int i = return_value; i > 0;) free((void*)(list[--i]));
free((void*)list);
int filename_isdir(const char *f);
const char *filename_name(const char *f);
const char *filename_ext(const char *f);
char *filename_setext(char *f,const char *ext);
int filename_expand(char *out, const char *in);
int filename_absolute(char *out, const char *in);
int filename_match(const char *f, const char *pattern);
*
matches any sequence of 0 or more characters.
?
matches any single character.
[set]
matches any character in the set. Set
can contain any single characters, or a-z to represent a range. To
match ] or - they must be the first characters. To match ^ or ! they
must not be the first characters.
[^set] or [!set]
matches any character
not in the set.
{X|Y|Z} or {X,Y,Z}
matches any one of
the subexpressions literally.
\x
quotes the character x so it has no special
meaning.
x
all other characters must be matched exactly.