All my other derived-class methods are called correctly but this one isn't for some reason.
class Widget
{
public:
//...
virtual void draw() {}
virtual void draw2() {}
virtual void frameupdate() { /* g_log<<"widg frameup"<<endl; g_log.flush(); */ }
//...
};
class EditBox : public Widget
{
public:
//...
void draw();
//...
void frameupdate();
//...
};
#define MOUSESC_DEBUG
void EditBox::frameupdate()
{
#ifdef MOUSESC_DEBUG
g_log<<"editbox frameup"<<endl;
g_log.flush();
#endif
//...
}
class View
{
//...
void frameupd()
{
//g_log<<"view frameup"<<endl;
//g_log.flush();
for(auto i=widget.begin(); i!=widget.end(); i++)
(*i)->frameupdate();
}
//...
};
The View calls frameupdate(); on each member widget, none of which are the base class (all are some derived type) and some are EditBox type.
Views output "view frameup" to the log.
The base class method frameupdate(); outputs "widg frameup" to the log.
The EditBox derived class outputs "editbox frameup".
What I can see in the log is "view frameup" and "widg frameup" but no "editbox frameup". The derived frameupdate(); method isn't being called. What the heck?