On 11/17/11 12:50, David Lopez wrote:
> It seems a silly question, but is there any way to know the number
> of items in an Fl_Input_Choice object?
Fl_Input_Choice::menubutton() returns a pointer to the underlying
Fl_Menu_Button inside the widget, letting you access all the usual
menu methods, including size() which returns the size of the menu.
In short:
int howmany = choice->menubutton()->size();
Note the size() count includes the terminator at the end,
so if you add() 3 items, the size() will be 4.
For more info, see Fl_Menu_::size(), eg:
http://fltk.org/doc-1.3/classFl__Menu__.html#a56d014765ec71a15ecca109348180f45
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk