[vtkusers] VTK CVS + wxPython...

Charl P. Botha c.p.botha at ewi.tudelft.nl
Wed Jul 21 10:42:35 EDT 2004


Charl P. Botha wrote:
> Andrea Gavana wrote:
> 
>> The funny thing is that wxVTKRenderWindow works great... I can't see a 
>> lot of
>> differences between the behavior of wxVTKrenderWindow and
>> wxVTKRenderWindowInteractor (as Python code, I don't know anything 
>> about the
>> C/C++ bases of them). I would like to use wxVTKRenderWindowInteractor 
>> because
>> is more flexible and nice (in my opinion). But it still don't work. I've
>> debugged the example in wxVTKRenderWindowInteractor and I saw that the 
>> second
>> window (the one with title "Visualization Toolkit - Win32OpenGL #1", 
>> with a
>> cone inside but not interactive) appears when 
>> wxVTKRenderWindowInteractor calls
>> widget.Initialize() and widget.Start(), but commenting them out does 
>> not help
>> me a lot... just eliminate the window with the cone and leaving me with a
>> completely grey window called "wxRenderWindow"...
> 
> 
> This is extremely strange... the wxVTKRenderWindowInteractor is working 
> (and has been working for years) here with VTK CVS and wxPython 2.4.2.4 
> in a rather extensive visualisation and image processing application on 
> both Debian stable and Windows XP and 2000, but I see (just now) that 
> I'm getting the same behaviour as you report on XP, but not on Debian.
> 
> I'm on it...

Okay, it seems that on Windows XP the OnPaint handler doesn't get called 
at window creation, which means that the rendering-to-wx-context logic 
doesn't get invoked until you force a redraw.  This is very strange.

In anycase, I've checked in some changes to 
wxVTKRenderWindowInteractor.py (primarily to the example part, with lots 
of documentation).  The widget.Initialize() and widget.Start() calls 
should be removed (they cause trouble) and replaced by widget.Enable(). 
  In addition, a SetSize() call should be made on the frame to make sure 
that it gets an OnPaint event when it's shown.

I'm going to spend more time on this later, but these changes should 
solve your problems.

Good luck,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: wxVTKRenderWindowInteractor.py
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040721/130a20e4/attachment.asc>


More information about the vtkusers mailing list