Hello
I have 2 classes like so ..
public class myButton : FL_Button
{
... do stuff // few hundred lines of code -
// these lines of code are exactly the same in
each type of class
}
public class myCheckButton : FL_Check_Button
{
... do stuff // few hundred lines of code -
// these lines of code are exactly the same in
each type of class
}
Then inside my main method
I call them like so ...
thisButton *myButton = new myButton(...)
or
thisCheckBox *myCheckBox = new myCheckButton(...)
I would like it if I could have a single class that is called - like so ...
public class myWidget : <relevant widget type>
{
... do stuff // few hundred lines of code
}
And then I would call it in my main method
myWidget *myButton = new myWidget<Fl_Button>(...)
or
myWidget *myCheckBox = new myWidget<Fl_Check_Button>(...)
The thing is that I am going to have tens of widgets represented by an
individual
class with hundreds if lines of the exact same code so
it would be great if I could use templates here somehow.
I know how to use templates (sort of) for a class I just don't know how to
use them on the "derived from" side of the ":".
Any help would be appreciated
Jason
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk