[vtkusers] Problem with VTK and wxPython under Win32

David Gobbi dgobbi at irus.rri.ca
Tue Mar 5 14:17:13 EST 2002


On Tue, 5 Mar 2002, David C. Morrill wrote:

> I was just wondering if anyone has had any experience (good or bad)
> using a VTK window in a wxPython app under Win32 (XP or 2000)?

I use it under 2000, though I haven't completely switched over from
Tkinter yet.

> I've taken a previously working VTK/wxPython app that imbeds a VTK
> window inside a wxFrame and modified it so that the VTK widget is
> imbedded within a wxBoxSizer within a wxNotebook page within a
> wxSplitterWindow within a wxFrame (more or less :-), and am now getting
> strange results and crashes.

Chances are that it is only one of these many things that is resulting in
the crash.

> For example, if I open/close the same visualization over and over, it
> may blow up on the 10th viewing. Or some of the actors on a subsequent
> display of the visualization may not be visible until the app calls
> SetRepresentationToWireframe/SetRepresentationToSurface.

Nearly all problems with wx and VTK result from the vtkRenderWindow
and the wxWindow not being in sync, i.e. if the vtkRenderWindow is
somehow created before the wxWindow or if the Size of the windows
doesn't match etc.  So that's the kind of stuff to look for.

Also, always make sure that you are using the most recent version
of wxVTKRenderWindow.py from CVS if you are doing any debugging.
If you're using the old wxVTKRenderWindow.py from the VTK 4.0
release, then there was a known problem with the wxSplitterWindow
that has been fixed.

> I'm currently trying to build a debug version of VTK and wxPython to
> get more details about the problem.

I almost always build VTK RelWithDebInfo and use non-debug builds of
everything else.  It means that it's only possible to see the debug
symbols in the VTK parts of the code, but that is sufficient for
most of my debugging purposes and is a lot easier than trying to
build debug versions of everything.

Good luck,

 - David




More information about the vtkusers mailing list