Edzard Egberts wrote:
> testalucida schrieb:
>> In the meantime I found out how to work with add:
>>
>> int n = 3;
>> Fl_Menu_Item *pop = new Fl_Menu_Item[n];
>> pop->add( "First item", 0, 0, 0, 0 );
>> pop->add( "Second item", 0, 0, 0, 0 );
>> ..
>> pop->popup( 10, 10, 0, 0, 0 );
>
> That's a really funny thing, I would never minded that to work!
Right, I don't think I'd have ever have thought that would work either.
But it seems to be valid, as Fl_Menu_Item's docs do have add() and
popup()
methods, and the (undocumented) code comment for Fl_Menu_Item::popup()
does say:
"popup menus without using an Fl_Menu_ widget"
Fl_Menu_Button is probably the better 'more reliable' way to go,
but I could see where using Fl_Menu_Item directly makes sense too,
so that you don't have to tie the popup menu to a particular bit
of widget real estate; you can do it /anywhere/.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk