Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: ppv on February 12, 2010, 10:31:27 pm
-
Hi I'm new at wxwidgets but I think I have found a problem.
I'm using night build 6088.
I start a project with wxsmith and put over the frame a GLCanvas, wxsmith create automatically a connection for this object in the constructor of the frame.
GLCanvas1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&P1Frame::OnGLCanvas1Paint,0,this);
But this connection provoke infinite message onpaint:
void P1Frame::OnGLCanvas1Paint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
}
so if I change the line to:
GLCanvas1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&P1Frame::OnGLCanvas1Paint,0,0);
or
GLCanvas1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&P1Frame::OnGLCanvas1Paint,NULL,NULL);
it start to work fine.
But every time I change something on the frame, wxsmith rewrite this code and that's kind of annoying.
-
someone else has noticed this problem? or know how to repair or avoide it? :?:
-
I have a problem using glcanvas where I put on the canvas and try to build and get tons of errors I don't change any of the code
-
A solution to the infinite loop is adding event.skip(); at the end of your OnGLCanvas1Paint. I'm not sure it's the good solution, but It works on some wxwidgets examples...
gd_on