On Nov 22, 2007, at 8:00 PM, Hartmut Sbosny wrote: > I build a menu dymamically by add()ing the items and want to change > some attributes. What is the proper way to do that? Background: The > Fl_Menu_::menu() function returns a pointer to the array of > Fl_Menu_Items > as a *const* pointer. The set-functions of class Fl_Menu_Item however > require non-constantness. Currently I cast simply away the 'const'
That is the proper way. The "const" is kind of a relic from old times and hints at the fact that using another "add()" may change the base pointer to your menu structure. Looking at the 12 year-old api today, a menu s of course nothing but another widget hierarchy, but back then, there were no submenus and an array was chosen to create a menu bar. FLTK2 is much better in this respect by using said hierarchy. Matthias ---- http://robowerk.com/ _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

