From 2a41af1fc3974a53041a5c315475c430f41c47c9 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Mon, 11 Sep 2017 18:12:58 +0000 Subject: 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 --- examples/howto-menu-with-images.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'examples') 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); -- cgit v1.2.3