summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2017-09-11 18:36:35 +0000
committerGreg Ercolano <erco@seriss.com>2017-09-11 18:36:35 +0000
commit2670903db904c029a181653881d948ab0173e068 (patch)
tree26ce2da7b892be2e1b73828ea54c90bcc0ee0cd4 /examples
parent2a41af1fc3974a53041a5c315475c430f41c47c9 (diff)
Simplified the example's menu item callback.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12442 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'examples')
-rw-r--r--examples/howto-menu-with-images.cxx17
1 files changed, 4 insertions, 13 deletions
diff --git a/examples/howto-menu-with-images.cxx b/examples/howto-menu-with-images.cxx
index 61c78af78..0a0e83c96 100644
--- a/examples/howto-menu-with-images.cxx
+++ b/examples/howto-menu-with-images.cxx
@@ -88,20 +88,11 @@ static Fl_Pixmap L_redx_pixmap(L_redx_xpm);
// Handle the different menu items..
void Menu_CB(Fl_Widget *w, void* data) {
- const char *itemname = (const char*)data; // "New", "Open", etc
- //DEBUG printf("Clicked on '%s'\n", itemname);
- if ( strcmp(itemname, "New") == 0 ) {
- fl_message("File/New would happen here..");
- } else if ( strcmp(itemname, "Open") == 0 ) {
- fl_message("File/Open would happen here..");
- } else if ( strcmp(itemname, "Quit") == 0 ) {
+ const char *itemname = (const char*)data; // "New", "Open", etc
+ if ( strcmp(itemname, "Quit") == 0 ) { // handle Quit
exit(0);
- } else if ( strcmp(itemname, "Copy") == 0 ) {
- fl_message("Edit/Copy would happen here..");
- } else if ( strcmp(itemname, "Paste") == 0 ) {
- fl_message("Edit/Paste would happen here..");
- } else {
- fl_message("'Image' operation '%s'..", itemname);
+ } else { // just show a message for other items
+ fl_message("'%s' would happen here", itemname);
}
}