In the examples directory file https://github.com/fltk/fltk/blob/master/examples/howto-menu-with-images.cxx
seems broken. If lines 159, 163, 167 are commented out
item->image(L_document_pixmap); // note: this clobbers the item's label()
item->image(L_folder_pixmap);
item->image(L_redx_pixmap);
then none of the Fl_Multi_Label images are displayed. Even the label images under File menu are not displayed. *BUT* if even one of the above item->image lines is executed then all the images under File menu are displayed. Looking at the original example file https://www.fltk.org/strfiles/3400/howto-menu-with-images_v2.cxx created by Greg E. I noticed that there are a couple lines removed in function AddItemToMenu in the current example in the git repo.
Specifically, the original code has these lines which were removed. line 118 const char *itemtext = item->label(); line 121 item->image(*pixmap); and the edit to line 132 ml->labelb = itemtext;
If I apply these changes, restoring the original code, then the example seems to work properly again. Wondering why those lines were removed from the original example?
The reason for my query is that we are trying to add Fl_Multi_Label support to pyFltk but we are trying to hide the implementation of function AddItemToMenu by adding void add_multi_label(Fl_Pixmap* pixmap) method to Fl_Menu_Item https://sourceforge.net/p/pyfltk/code/563/
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/8a249e74-c28a-4b51-ba63-edfdfca027ebn%40googlegroups.com.
[ Direct Link to Message ] |