Inherited by fltk::StringArray.
Public Member Functions | |
virtual int | children (const Menu *)=0 |
virtual int | children (const Menu *, const int *indexes, int level) |
virtual const char * | label (const Menu *, int index)=0 |
virtual const char * | label (const Menu *, const int *indexes, int level) |
Typically you will create a subclass with the children() and label() functions overridden, and make a single static instance of this class. It can be used by several menus, but the Menu* argument to children() and label() is used to differentiate them.
class MyList : public StringList { int children(const Menu* menu) { return ((MyClass*)(menu->user_data()))->number_of_items(); } const char* label(const Menu* menu, int index) { return ((MyClass*)(menu->user_data()))->label(index); } }; static MyList myList; Menu themenu; MyClass myobject; themenu->list(&mylist); themenu->callback(mycallback, &myobject);