Author Topic: wxsmith: wxglcanvas->connect() problem  (Read 7525 times)

Offline ppv

  • Single posting newcomer
  • *
  • Posts: 5
wxsmith: wxglcanvas->connect() problem
« 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.



Offline ppv

  • Single posting newcomer
  • *
  • Posts: 5
Re: wxsmith: wxglcanvas->connect() problem
« Reply #1 on: February 17, 2010, 09:53:59 pm »
someone else has noticed this problem? or know how to repair or avoide it? :?:

Offline LinuxhaxU

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: wxsmith: wxglcanvas->connect() problem
« Reply #2 on: March 10, 2011, 08:23:40 pm »
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

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: wxsmith: wxglcanvas->connect() problem
« Reply #3 on: March 11, 2011, 08:53:09 am »
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
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).