[vtkusers] Multiple vtkTkRenderWidget in python
CHENET Aude (External)
Aude.CHENET-ext at galderma.com
Mon Apr 11 07:48:01 EDT 2016
Hi,
I'm using vtk with python and try to do the following program :
Choose a file using tkFileDialog (filepath = tkFileDialog.askopenfilename(title="Choisir une image",filetypes=[('tif files','.tif'),('tiff files','.tiff')]))
Show the image in a window (render_widget = vtkTkRenderWindowInteractor(renderer_frame,
rw=renWin, width=600,
height=500))
My program have the following error
Traceback (most recent call last):
File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 328, in <module>
V = Viewer(filepath)#("D:\resultatsOCT\Didier Cheek01 b_reconstr.tif")
File "C:\Users\chenet-ext\workspace\OCT\src\afficheComplet.py", line 165, in __init__
height=500)
File "C:\Python27\Lib\site-packages\vtk\tk\vtkTkRenderWindowInteractor.py", line 70, in __init__
Tkinter.Widget.__init__(self, master, 'vtkTkRenderWidget', cnf, kw)
File "C:\Python27\Lib\lib-tk\Tkinter.py", line 2090, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: invalid command name "vtkTkRenderWidget"
The program runs normally if I don't call tkFileDialog to choose the file. It seems like we can't call tkFileDialog and then create a vtkTkRenderWindowInteractor
Does anyone have an idea?
Aude
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160411/35fea87e/attachment.html>
More information about the vtkusers
mailing list