diff options
| author | Greg Ercolano <erco@seriss.com> | 2017-09-11 18:12:58 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2017-09-11 18:12:58 +0000 |
| commit | 2a41af1fc3974a53041a5c315475c430f41c47c9 (patch) | |
| tree | f980182412d3c3722aa1934b8e95870ec1ad480c /examples | |
| parent | 88204a55245d41d0cbcec4c8b0e946c38de92549 (diff) | |
Applied Manolo's recommendation (fltk.coredev), removing unnecessary item->image(*pixmap) call.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12441 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/howto-menu-with-images.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/howto-menu-with-images.cxx b/examples/howto-menu-with-images.cxx index 5df44507d..61c78af78 100644 --- a/examples/howto-menu-with-images.cxx +++ b/examples/howto-menu-with-images.cxx @@ -117,10 +117,6 @@ int AddItemToMenu(Fl_Menu_ *menu, // menu to add item to if ( !pixmap ) return i; Fl_Menu_Item *item = (Fl_Menu_Item*)&(menu->menu()[i]); - const char *itemtext = item->label(); // keep item's label() -- item->image() clobbers it! - - // Assign image to menu item - item->image(*pixmap); // note: clobbers item->label() // Create a multi label, assign it an image + text Fl_Multi_Label *ml = new Fl_Multi_Label; @@ -131,7 +127,7 @@ int AddItemToMenu(Fl_Menu_ *menu, // menu to add item to // Right side of label is text ml->typeb = FL_NORMAL_LABEL; - ml->labelb = itemtext; + ml->labelb = item->label(); // Assign multilabel to item ml->label(item); |
