<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3502.5390" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>From: "Prabhu Ramachandran" &lt;<A 
href="mailto:prabhu@aero.iitm.ernet.in">prabhu@aero.iitm.ernet.in</A>&gt;<BR><BR>&gt; 
&gt;&gt;&gt;&gt;&gt; "BR" == Benoit Regrain &lt;<A 
href="mailto:benoit.regrain@creatis.insa-lyon.fr">benoit.regrain@creatis.insa-lyon.fr</A>&gt; 
writes:<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; I have made some tests 
concerning reparenting. With the method<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; 
SetNextWindowId placed in vtkXOpenGLRenderWindow we can 
change<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; properly the drawing window id. To 
use it in python, it is<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; necessary to have 
method SetNextWindowInfo, like we have<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; 
SetWindowInfo.<BR>&gt;<BR>&gt; It is possible to add a SetNextWindowInfo method 
to the<BR>&gt; vtkXOpenGLRenderWindow class but the question is will this be a 
cross<BR>&gt; platform solution or an X-only solution?&nbsp; How would you 
achieve<BR>&gt; re-parenting under Win32 or Mac OS X?&nbsp; Or is that already 
possible to<BR>&gt; do?&nbsp; In any case I think since vtkXOpenGLRenderWindow 
already provides<BR>&gt; a SetNextWindowId method, adding a SetNextWindowInfo 
should be fine.<BR>&gt;<BR>&gt; The other issue is that VTK is due for a 4.2 
release shortly and I am<BR>&gt; not sure making this addition at this time is a 
good idea (although I<BR>&gt; don't see it introducing any new problems).&nbsp; 
So maybe after the 4.2<BR>&gt; release this can be added?<BR><BR>Concerning the 
method SetNextWindowId, it exists for Win32, WinCE and X platforms.<BR>The 
SetNextWindowInfo will only make the same work than SetNextWindowId, as 
SetWindowInfo makes the same work than SetWindowId.<BR>The variable modified by 
this method (variable this-&gt;NextWindowId) is afterused by WindowRemap, 
only.<BR>Under Windows, it works perfectly without that mecanism. But under 
linux, we must use it to supprim errors.<BR>Concerning Mac Carbon platform, the 
WindowRemap exists, but generates an error... (I don't have Mac environement to 
test it)<BR>Therefore, add the SetWindowInfo in vtkRenderWindow class will not 
add problems.<BR>I think it can be made for the 4.2 
release.<BR><BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; I would know why you 
don't have write the method<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; 
SetNextWindowId in class vtkRenderWindow, and if you 
could<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; make that and add the method 
SetNextWindowInfo.&nbsp; What must I<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; make 
or send to you to have these modifications in the 
next<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; VTK nightly ???<BR>&gt;<BR>&gt; 
Nothing really.&nbsp; In this case I think the change should be fairly 
easy<BR>&gt; to make.&nbsp; You just need to get the attention of one of 
the<BR>&gt; developers. :)<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; I must 
work a little to python class wxVTKRenderWindow to 
have<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BR&gt; properly code.<BR>&gt;<BR>&gt; The 
wxVTKRenderWindow class and the Interactor class are not perfect.<BR>&gt; Fixes 
are most welcome. :)<BR>&gt;<BR>&gt; cheers,<BR>&gt; prabhu<BR><BR>To combine 
with these little modifications, wxVTKRenderWindow must be modified :<BR>&nbsp;- 
variable self.__Created is replaced by self.__Handle wich is the Handle id of 
current window used.<BR>&nbsp;- test in Render method to verify the handle used 
by VTK. It is made her because a reparent on an ancestor of vtkRenderWindow will 
change Handle id<BR>I remenber you a change that I had made before concerning 
the default size of vtkRenderWindow at creation of 
vwVTKRenderWindow...<BR><BR>After some tests, I have found an other error which 
is :<BR>&nbsp;- when I reparent a wx widget wich have more than one 
vtkRenderWindow inside, I obtain a segmentation fault under linux (windows 
didn't have problems).<BR>&nbsp;- the segmentation fault appears always in the 
same case depending of position and order of displays (in the window).<BR>To 
solve that (and I don't know if it's the best method because I'm a beginner in 
XLib), I'm closing the display when the drawing context is 
destroyed.<BR><BR><BR>I you can find files that I have modified and tested on 
windows2000 and Linux :<BR>&nbsp;- vtkRenderWindow.h<BR>&nbsp;- 
vtkXOpenGLRenderWindow.h<BR>&nbsp;- vtkXOpenGLRenderWindow.cxx<BR>&nbsp;- 
vtkWin32OpenGLRenderWindow.h<BR>&nbsp;- 
vtkWin32OpenGLRenderWindow.cxx<BR>&nbsp;- wxVTKRenderWindow.py</DIV>
<DIV>at the URL : <A 
href="http://www.creatis.insa-lyon.fr/~regrain/VTK/patch">www.creatis.insa-lyon.fr/~regrain/VTK/patch</A><BR><BR>I 
hope have omitted nothing. And if have any questions concerning that, I'm<BR>to 
your disposal.<BR><BR>Greatings to consider that before the next release 
:-D<BR><BR>Benoit Regrain<BR></DIV></BODY></HTML>