[vtkusers] Destroy vtkRenderWindow before TkRenderWidget...?

Uwe Rempler rempler at mechbau.uni-stuttgart.de
Fri Jan 16 13:19:48 EST 2004


hi list,

i've got an odd error message when trying to destroy a tkrenderwidget 
within a tkinter toplevel- or even a tk-widget:

Generic Warning: In 
/debian/stage/vtk-4.2.4/Rendering/vtkTkRenderWidget.cxx, line 638
A TkRenderWidget is being destroyed before it associated vtkRenderWindow 
is destroyed. This is very bad and usually due to the order in which 
objects are being destroyed. Always destroy the vtkRenderWindow before 
destroying the user interface components

i'm trying to visualize some data in multiple tk-windows opened from one 
main-window using python v2.3. and vtk v4.2.4 on debian.
therefore i'm building the main-window inheritated from tkinter.tk(). 
the afterwards following subwindows are tk.toplevel() widgets.
if i now embed the protocol-handler "WM_DELETE_WINDOW" in the 
sub-window-class to exit the single windows clean with 
tkinter.toplevel.destroy() i get the error-message above. if i try to 
exit this sub-windows with tkinter.tk.quit() i'm getting no error but my 
mainwindow/application also quits :-( got a notion that's because 
tkinter.*.quit() exits the tcl-interpreter too...)

i've already tried some nested mainloops() but i wasn't able to quit() 
the right level/loop - always killed my main-window as well...
also tried to withdraw() the sub-windows and then finally make a 
tkinter.tk.quit() but in the end i got the error-message for every 
subwindow minimized...
are there any functions to directly close/destroy the vtkrenderwindow?


cheers

uwe



More information about the vtkusers mailing list