The most straightforward thing to do is add a virtual function to SelectionResource that returns the callback to attach to the FLTK items we create. Is that OK, or do we need something more abstract?
Sounds ok to me, if it is necessary. I'm only starting to understand the FltkSelectionResource stuff however :-)
I've got something working that adds the callback as a virtual function in the FltkListResource::Item class. Unfortunately it requires adding some other virtual functions and some extremely verbose template code (+ use of the typename keyword to get it all through the parser) so I'm keen to simplify things.
Or would it be possible to connect the callback in createNewMenu() which is virtual already? If you look at the test/menu.cxx from fltk-2, there they install one callback per menu and get the item using get_item().
That might be much simpler than what I currently have. I'd much rather reuse the virtual functions we already have than add new ones. Thanks for the tip, I'll give it a go! Jeremy Henty