<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>I believe I might have found two bugs in the class wxVTKRenderWindow<BR>as 
encountered in VTK/Wrapping/Python/vtk/wx/wxVTKRenderWindow.py.<BR>I am working 
on Windows 2000 with the VTKNightly dated 10/02/2002.<BR><BR>&nbsp;- At launch 
of the script wxVTKRenderWindow.py, a window appears, but<BR>&nbsp;&nbsp; 
nothing is displayed inside. Things become correct when I resize 
the<BR>&nbsp;&nbsp; window. (This was also reported by Chandra Shekhar, 
see<BR>&nbsp;&nbsp;&nbsp; <A 
href="http://public.kitware.com/pipermail/vtkusers/2002-October/013700.html">http://public.kitware.com/pipermail/vtkusers/2002-October/013700.html</A>)<BR>&nbsp;&nbsp; 
I could fix this problem, by changing the line 164 by 
:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
try:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
size = parent.GetSize()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
except:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
size = wxDefaultSize<BR>&nbsp;&nbsp; The try/except is used to protect the call 
to parent.<BR>&nbsp;<BR>&nbsp;- When the script wxVTKRenderWindow.py is launched 
and when killing<BR>&nbsp;&nbsp; the window (by clicking on the window close 
button, the one with a<BR>&nbsp;&nbsp; cross at the upper right), I get the 
following error message in <BR>&nbsp;&nbsp; the Python console 
:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; runtime error 
R6025<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Pure virtual 
function call<BR>&nbsp;&nbsp; This odd/bad behavior desapears when I add the 
line :<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
widget.GetRenderWindow().RemoveRenderer(ren)<BR>&nbsp;&nbsp; at the end of test 
script, just after the line containing the<BR>&nbsp;&nbsp; "MainLoop" function. 
But I think that the problem is in the class<BR>&nbsp;&nbsp; wxVTKRenderWindow : 
Renderers might be refered to after they have<BR>&nbsp;&nbsp; allready been 
deleted/gced.<BR>&nbsp;&nbsp; To address this problem one could handle the 
proper deconnection<BR>&nbsp;&nbsp; of the RenderWindow from it's renderer[s] by 
adding a destructor<BR>&nbsp;&nbsp; to the wxVTKRenderWindow class. The 
following does the job for me:<BR><BR>&nbsp;&nbsp; def 
__del__(self):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; renderers = 
self._RenderWindow.GetRenderers()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
numRenderers = 
renderers.GetNumberOfItems()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
self._CurrentRenderer = None<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
renderers.InitTraversal()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for i in 
range(0,numRenderers):<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
self.GetRenderWindow().RemoveRenderer(renderers.GetNextItem())<BR><BR>&nbsp; 
<BR>Thanks for considering those problems.<BR>Greetings<BR></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Benoit Regrain<BR>Ingénieur d'étude CNRS 
(Creatis)<BR>email : <A 
href="mailto:regrain@creatis.insa-lyon.fr">regrain@creatis.insa-lyon.fr</A><BR>INSA 
- Bâtiment Blaise Pascal<BR>7 avenue Jean Capelle<BR>69621 Villeurbanne 
Cedex<BR></FONT></DIV></BODY></HTML>