Re: [wxVTK] Re : wxVTKRWI, wxAuiManager and reparenting
Brought to you by:
malat
From: Mathieu M. <mat...@gm...> - 2008-08-25 12:03:11
|
Hi Quoc Cuong, On Mon, Aug 25, 2008 at 1:48 PM, Quoc Cuong PHAM <quo...@ce...> wrote: > this->Hide(); > > before the line: > m_pVTKWindow = new wxVTKRenderWindowInteractor(this, MY_VTK_WINDOW, pos, > size) > > because I use wxGLCanvas wow ! I do not know how I can patch wxVTK to support that ... > - a second error occurs when the wxVTKRenderWindowInteractor::UpdateSize() > is called with the same size as the initial size (at the creation > wxVTKRenderWindowInteractor) > if I do > void FrameGL::OnSize(wxSizeEvent& event) > { > cout<<"FrameGL::OnSize()"<<endl; > wxSize size = event.GetSize(); > // cout<<"change size = "<< size.GetWidth() <<" "<< size.GetHeight() << > endl; > if (size!= this->initialSize) That seems a resonable patch. Thanks. > - then the application does not crash in UpdateSize() anymore but further, > in the reparent section of the Render() as I mentioned in my first email > > else if(GetHandleHack()) > { > //this means the user has reparented us; let's adapt to the > //new situation by doing the WindowRemap dance > //store the new situation > Handle = GetHandleHack(); > cout<<"Handle (reparent)= "<< Handle << endl; > RenderWindow->SetNextWindowId(reinterpret_cast<void *>(Handle)); // > CRASH HERE !!!! no the crash cannot happen here. RenderWindow is a valid pointer and Handle is simply an integer, on linux you can always cast an integer to a void* pointer. So the bug must appear somewhere before. On your linux station, please install valgrind, and start you application this ways: $ valgrind -v ./aui-sample (replace aui-sample with whatever the name of your app is). Then send us back the valgrind output, or study it, it is fairly easy to read. HTH -- Mathieu |