I've been trying to override Show() method from a class derived from wxFrame, but could not get it to work, possibly due to my incompetence in both C++ and understanding of wxWidgets in general
Suppose I have the following class header:
Code: Select all
#include <wx/wx.h>
class SuperDumbFrame : public wxFrame
{
public:
SuperDumbFrame();
bool Show(bool) wxOVERRIDE;
wxFrame *dumbframe;
};
Code: Select all
#include "dumbframe.h"
SuperDumbFrame:: SuperDumbFrame()
: wxFrame(NULL, wxID_ANY, wxEmptyString, wxDefaultPosition)
{
dumbframe = this;
}
bool SuperDumbFrame::Show(bool show=true)
{
std::cout << "in show ..." << std::endl;
return dumbframe->Show(show);
}
Code: Select all
#include <wx/wx.h>
#include "dumbframe.h"
class MyApp : public wxApp
{
public:
bool OnInit();
};
class MyFrame : public SuperDumbFrame
{
public:
MyFrame();
~MyFrame();
};
bool MyApp::OnInit()
{
MyFrame *myframe = new MyFrame();
myframe->Show(true);
return true;
}
MyFrame::MyFrame()
: SuperDumbFrame()
{
}
MyFrame::~MyFrame()
{
}
IMPLEMENT_APP( MyApp )
Your help is very much appreciated.