Original Post
hi all,
I''m getting a real headache from this, and I''d sooooo appreciate a little friendly help!
I have a general GUI/UI system in C++. It has the standard buttons/labels/text boxes/whatever..
I read a tutorial on Functors, and I made a previous post: here. That solved a few problems, but I''m still missing one key thing. Generics.
Say, I want to allow a control to have (Java style) addHandler() type methods - yet still in some generic sense - that is, not be too specific as to what TYPE of event (mouse, click, option-change etc..) and not too specific WHO handle it (what type of window class).
I used templates:
template < class _handler > class HANDLER_ClickEvent {
BUT, that doesn''t work generically, I can''t just ask for a "HANDLER_ClickEvent" class as it requires the template parameter be defined, which i Don''t want to do (could be any number of different classes that handle events).
any ideas? I really don''t get how I can do a generalised *event* from a given control to a given container...
cheers,
Jack