Skip to content

Commit

Permalink
Tooltip for browse button, and include a fallback label if icon not f…
Browse files Browse the repository at this point in the history
…ound.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13098 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
erco77 committed Oct 29, 2018
1 parent cfe555f commit 554d7d3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/file_chooser.cxx
Expand Up @@ -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);
Expand Down

0 comments on commit 554d7d3

Please sign in to comment.