On 12 Dec 2009, at 6:56, manolo gouy wrote:

> Regarding
>> New API proposal:
>> - fl_mac_set_about(const Fl_Menu_Item *item)
>> to connect an FLTK menu item to the "About myprog" application  
>> menu item
>
> While testing the new Fl_Sys_Menu_Bar->add() and remove(), I have
> discovered a most unexpected (at least by me) property of FLTK menus:
> when one menu is modified, say by add() calls, the array of  
> Fl_Menu_Items
> of ANOTHER menu can be moved to a different memory place!
> Thus, never memorize a pointer to Fl_Menu_Items, it can be invalidated
> by uncontrolable events.
>
> To me, this suggests that the above proposed API is not coherent with
> the FLTK logic whereby Fl_Menu_Items should always be accessed through
> Fl_Menu_::menu(). Shouldn't we rather use this API:
> fl_mac_set_about(const char* label, int shortcut, Fl_Callback*,  
> void *user_data=0, int flags=0);
> that mirrors the argument list of Fl_Menu_::add()
>
> or this other one that takes only really useful arguments:
> fl_mac_set_about(Fl_Callback*, void *user_data, int shortcut=0);

If this is the things we need to pass, then maybe this is the API we  
should use?

Making the API congruent with the Fl_Menu_::add() API might be nice -  
but is it necessary?

Perhaps the (mythical) generic fl_mac_set_about(...) would have an  
API that is congruent with Fl_Menu_::add(), and the mac specific  
fl_mac_set_about(...) would have this subset?

> I need expert advice please.

Not sure if I am qualified here...


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

Reply via email to