summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2017-09-12 20:10:25 +0000
committerGreg Ercolano <erco@seriss.com>2017-09-12 20:10:25 +0000
commite2a28fa071972751dcdfddd416678f284755e0e7 (patch)
tree5cf66a5fe7766de65533b1dc92781064ce5077a8 /examples
parent900314d4f4047e4c21130e8551c4b29436b960d0 (diff)
Add divider above Quit menu item. (needed for demo screenshot)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12451 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'examples')
-rw-r--r--examples/howto-menu-with-images.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/howto-menu-with-images.cxx b/examples/howto-menu-with-images.cxx
index 4682dca71..04b01c1fb 100644
--- a/examples/howto-menu-with-images.cxx
+++ b/examples/howto-menu-with-images.cxx
@@ -102,9 +102,10 @@ int AddItemToMenu(Fl_Menu_ *menu, // menu to add item to
int shortcut, // shortcut (e.g. FL_COMMAND+'a')
Fl_Callback *cb, // callback to invoke
void *userdata, // userdata for callback
- Fl_Pixmap* pixmap) { // image (if any) to add to item
+ Fl_Pixmap* pixmap, // image (if any) to add to item
+ int flags=0) { // menu flags (e.g. FL_MENU_DIVIDER..)
// Add a new menu item
- int i = menu->add(labeltext, shortcut, cb, userdata);
+ int i = menu->add(labeltext, shortcut, cb, userdata, flags);
if ( !pixmap ) return i;
Fl_Menu_Item *item = (Fl_Menu_Item*)&(menu->menu()[i]);
@@ -138,7 +139,7 @@ void CreateMenuItems(Fl_Menu_* menu) {
// Add items with LABLES AND IMAGES using Fl_Multi_Label..
AddItemToMenu(menu, "File/New", FL_COMMAND+'n', Menu_CB, (void*)"New", &L_document_pixmap);
- AddItemToMenu(menu, "File/Open", FL_COMMAND+'o', Menu_CB, (void*)"Open", &L_folder_pixmap);
+ AddItemToMenu(menu, "File/Open", FL_COMMAND+'o', Menu_CB, (void*)"Open", &L_folder_pixmap, FL_MENU_DIVIDER);
AddItemToMenu(menu, "File/Quit", FL_COMMAND+'q', Menu_CB, (void*)"Quit", &L_redx_pixmap);
// Create menu bar items with JUST LABELS