> class MyStringList : public StringList {
>      public:
>      int children(const Menu* menu) {
>          return ((Menu*)(menu->user_data()))->number_of_items();
>      }
>      const char * label(const Menu* menu, int index) {
>          return ((Menu*)(menu->user_data()))->label(index);
>      }
> };

In http://www.fltk.org/doc-2.0/html/classfltk_1_1StringList.html I had already 
seen the hint to create a subclass, but I was able to figure out what is meant 
for what 'MyClass*' stands (sure, a pointer on a class, but with which 
properties).
When I try to use your code snippet, I get one error saying that 
'number_of_items' is no element of the class fltk::menu (line 4) and another 
one lamenting an impossible conversion from 'int' to 'const char *' in 'void 
fltk::Widget::label(const char *)' (line 7).
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to