<!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><FONT face=Arial size=2>I have a program containing one wxVTKRenderWindow 
(see below). </FONT></DIV>
<DIV><FONT face=Arial size=2>The choice in the menu offers possibility to move 
the wxVTKRenderWindow </FONT></DIV>
<DIV><FONT face=Arial size=2>from one&nbsp;panel to an other&nbsp;panel placed 
around a splitter window. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>To change the panel containing the 
wxVTKRenderWindow, I'm using the Reparent</FONT></DIV>
<DIV><FONT face=Arial size=2>method. At this moment,&nbsp;a BadWindow mesage 
appears from GTK (serail 48 error_code 3 minor_code 0)</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm certain that the Reparent method of wxWindow is 
the source of problem, but I haven't found solution.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The goal of that is to move widget containing 
wxVTKRenderWindow object from one panel to an other (the widget can have a 
complex interface with VTK and wxWindow elements)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Greatings</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT></DIV>
<DIV><FONT face=Arial size=2>Program</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial 
size=2>////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT></DIV>from 
wxPython.wx import *<BR>from vtkpython import *<BR>from wxVTKRenderWindow import 
wxVTKRenderWindow</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>if __name__ == '__main__':<BR>&nbsp;import 
sys<BR>&nbsp;import os</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;class TestApp(wxApp):<BR>&nbsp;&nbsp;def 
OnInit(self):<BR>&nbsp;&nbsp;&nbsp;self.frame=wxFrame(None,-1,"dvwGrid",size=(640,480))</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;self.splitter=wxSplitterWindow(self.frame,-1)<BR>&nbsp;&nbsp;&nbsp;self.left=wxPanel(self.splitter,-1)<BR>&nbsp;&nbsp;&nbsp;self.right=wxPanel(self.splitter,-1)<BR>&nbsp;&nbsp;&nbsp;self.splitter.SplitVertically(self.left,self.right,50)<BR>&nbsp;&nbsp;&nbsp;self.frame.Show(true)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;self.onLeft=true<BR>&nbsp;&nbsp;&nbsp;self.window=wxVTKRenderWindow(self.left,-1)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;self.MakeMenu()</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;&nbsp;&nbsp;EVT_SIZE(self.left,self.OnSize)<BR>&nbsp;&nbsp;&nbsp;EVT_SIZE(self.right,self.OnSize)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp;return(true)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;def 
MakeMenu(self):<BR>&nbsp;&nbsp;&nbsp;menu=wxMenu()<BR>&nbsp;&nbsp;&nbsp;menu.Append(6551,"Flit 
window")<BR>&nbsp;&nbsp;&nbsp;mb=wxMenuBar()<BR>&nbsp;&nbsp;&nbsp;mb.Append(menu,"Edit")<BR>&nbsp;&nbsp;&nbsp;self.frame.SetMenuBar(mb)<BR>&nbsp;&nbsp;&nbsp;EVT_MENU(self.frame,6551,self.OnMenu)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;def 
OnSize(self,event=None):<BR>&nbsp;&nbsp;&nbsp;if(self.onLeft):<BR>&nbsp;&nbsp;&nbsp;&nbsp;self.window.SetSize(self.left.GetSize())<BR>&nbsp;&nbsp;&nbsp;else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;self.window.SetSize(self.right.GetSize())</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;def 
OnMenu(self,event):<BR>&nbsp;&nbsp;&nbsp;if(self.onLeft):<BR>&nbsp;&nbsp;&nbsp;&nbsp;self.window.Reparent(self.right)<BR>&nbsp;&nbsp;&nbsp;else:<BR>&nbsp;&nbsp;&nbsp;&nbsp;self.window.Reparent(self.left)<BR>&nbsp;&nbsp;&nbsp;self.onLeft=not 
self.onLeft<BR>&nbsp;&nbsp;&nbsp;self.OnSize()</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;#lancement de l'application<BR>&nbsp;app = 
TestApp(0)<BR>&nbsp;app.MainLoop()<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT>
<DIV><FONT face=Arial 
size=2>-----------------------------------------------------------------<BR>Benoit 
Regrain<BR>Ingénieur d'études 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>F - 69621 Villeurbanne 
Cedex</FONT></DIV></BODY></HTML>