Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

wxsmith: wxglcanvas->connect() problem

(1/1)

ppv:
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.


ppv:
someone else has noticed this problem? or know how to repair or avoide it? :?:

LinuxhaxU:
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

gd_on:
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

Navigation

[0] Message Index

Go to full version