?
=?ISO-8859-1?Q?Martin_H=F6ller?=
Hi!
I'm trying to make a button class for an SDL app. The button should be
able to store a callback to a member function of another class. For that
purpose I implemented a template class named CallBack<Class, ReturnType>
with operator() which works fine.
My problem now is the usage of CallBack in the button.
I want to create the button like this:
CallBack<MyClass, void> *cb = new CallBack(this, MyClass::buttonClick);
Button *my_button = new Button("This is a button", x, y, cb);
How do I tell the button to take ANY type of callback? I don't want to
make the button class a template class...
Thanks for the help,
Martin
I'm trying to make a button class for an SDL app. The button should be
able to store a callback to a member function of another class. For that
purpose I implemented a template class named CallBack<Class, ReturnType>
with operator() which works fine.
My problem now is the usage of CallBack in the button.
I want to create the button like this:
CallBack<MyClass, void> *cb = new CallBack(this, MyClass::buttonClick);
Button *my_button = new Button("This is a button", x, y, cb);
How do I tell the button to take ANY type of callback? I don't want to
make the button class a template class...
Thanks for the help,
Martin