Hi all,

for my app, the number of the desired popup menu items is not known at design 
time. When running the app, the items will be read from a database.
That's why I can't use the suggested way:

Fl_Menu_Item popup[] = {
   { "Item 1",  0, handle_menu, (void*)"AB" },
   { "Item 2",  0, handle_menu, (void*)"CD" },
   { "Item 3",  0, handle_menu, (void*)"EF" },
   { 0 }
};

Instead I tried like that:
Fl_Menu_Item *pFileMenu = new Fl_Menu_Item();
/** provide font, callback, label,...)*/
pFileMenu->add( "next Item", 0, handle_menu, (void*)"userdata" );

This compiles but crashes when executing - probably because the two items are 
not forming an array. I tried to debug the fltk sources but couldn't get along 
with it.

Does somebody have a tip for me how to build a menu dynamically?
And what is that add() method good for when I can't use it?

Thanks in advance
testalucida

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to