[vtkusers] Access Violations in wxVTKRenderWindow Example

Charl P. Botha c.p.botha at its.tudelft.nl
Sun Jan 19 12:30:20 EST 2003


On Sun, Jan 19, 2003 at 08:28:26AM +0530, Prabhu Ramachandran wrote:
> I dont know about the access violation but I've removed the obsoleted
> function call in wxVTKRenderWindowInteractor.py, so you should not
> have a problem with the message window anymore.  This fix is in VTK
> CVS.

Hi there Prabhu,

I have another interesting problem that I'm busy tracking down.  If you have
a wxVTKRWI (RWI == RenderWindowInteractor) embedded in a wxFrame somewhere,
there is no clean way to destroy that wxFrame.

If you call Destroy() on it (the recommended wx way), the vtkRenderWindow
will cause an assert error (BadWindow) and terminate your application when
it finally destructs, due to  the fact that the various vtkRenderWindow
destructors assume that the window pointed to by the WindowId still exists,
although it was destroyed during the Destroy() call.  Remember that from
Python, there's no clean way to force immediate destruction of e.g. a
wrapped vtkRenderWindow...

I've been looking for a clean way to solve this, but so far my only
candidate is calling WindowRemap() on the vtkRenderWindow of the wxVTKRWI
before Destroy()ing the containing frame.  The WindowRemap will cause the
RenderWindow to create its own window before subsequently (and very shortly
after) destroying it.  At least now the application is still running.
Unfortunately, WindowRemap() only works on X and Win32, but not on Mac-OS
(Carbon).  If you have any ideas w.r.t. this, I'd like to discuss them.

Keep well,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtkusers mailing list