summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2018-10-29 19:33:11 +0000
committerGreg Ercolano <erco@seriss.com>2018-10-29 19:33:11 +0000
commit554d7d363903d0626cb9c9dfee54e55c71c6a5b7 (patch)
tree5352b19d9a5d404b3973c694c1b6fcedd80fb500
parentcfe555f410ca018726c924a1b4c2679b87ab607d (diff)
Tooltip for browse button, and include a fallback label if icon not found.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13098 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--test/file_chooser.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/file_chooser.cxx b/test/file_chooser.cxx
index 81328719a..5421eaa1b 100644
--- a/test/file_chooser.cxx
+++ b/test/file_chooser.cxx
@@ -124,11 +124,16 @@ main(int argc, // I - Number of command-line arguments
"C/C++ Source Files (*.{c,C,cc,cpp,cxx})");
button = new Fl_Button(365, 10, 25, 25);
- button->labelcolor(FL_YELLOW);
+ button->tooltip("Click to open file browser..");
button->callback((Fl_Callback *)show_callback);
-
- icon = Fl_File_Icon::find(".", Fl_File_Icon::DIRECTORY);
- icon->label(button);
+ if ( (icon = Fl_File_Icon::find(".", Fl_File_Icon::DIRECTORY)) ) {
+ // Icon found; assign it..
+ button->labelcolor(FL_YELLOW);
+ icon->label(button);
+ } else {
+ // Fallback if no icon found
+ button->label("..");
+ }
button = new Fl_Light_Button(50, 45, 80, 25, "MULTI");
button->callback((Fl_Callback *)multi_callback);