Hello!
I'm using C::B 20.03 and wxWidgets 3.0.x. on Windows 10 (64 bit).
I would like use correctly a timer in my C++ program with wxSmith, but I don't know, how can I add an own function to a created timer at runtime?
I tried so:
wxw30testappFrame::wxw30testappFrame(wxWindow* parent,wxWindowID id)
{
//(*Initialize(wxw30testappFrame)
Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
Connect(wxEVT_PAINT,(wxObjectEventFunction)&wxw30testappFrame::OnPaint);
Connect(wxEVT_KEY_DOWN,(wxObjectEventFunction)&wxw30testappFrame::OnKeyDown);
//*)
void ScrRefresh(wxTimerEvent& event);
wxTimer* scrrefresher=new wxTimer();
scrrefresher->Start(25);
//scrrefresher->Bind(wxEVT_TIMER,ScrRefresh,this)
Connect(wxEVT_TIMER,(wxObjectEventFunction)&wxw30testappFrame::ScrRefresh);
}
(...)
void wxw30testappFrame::ScrRefresh(wxTimerEvent& event)
{
Update();
}
But I get the following error messages after these:
error: 'ScrRefresh' is not a member of 'wxw30testappFrame'
error: no declaration matches 'void wxw30testappFrame::ScrRefresh(wxTimerEvent&)'
Somebody can explain me that what is the correct way to assign a function to a Timer event?