[vtkusers] vtkTkRenderWidget on OSX

Martin Costabel costabel at wanadoo.fr
Tue Nov 1 11:14:11 EST 2005


Lise Angell wrote:
> Dear vtk-users,
> 
> I would like to make a small gui for my VTK application (calls VTK from Python).
> I found examples using vtkTkRenderWidget, but my VTK installation
> doesn't seem to find the tkRenderWidget...
> 
>>>> import vtk
>>>> widget = vtk.vtkTkRenderWidget()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: 'module' object has no attribute 'vtkTkRenderWidget'
> 
> I have installed VTK from cvs (oct.19 2005) with the python and tcl bindings.
> Has anyone succeded using this widget on osx?

Yes, as part of the test_vtk.py module from mayavi. This runs correctly 
with the vtk-py23 package from Fink. The syntax in test_vtk.py is 
somewhat different, see
http://cvs.sourceforge.net/viewcvs.py/*checkout*/mayavi/mayavi/doc/test_vtk.py

   import vtk
   from vtk.tk.vtkTkRenderWidget import vtkTkRenderWidget
   import Tkinter
   t = Tkinter.Toplevel()
   pane = vtkTkRenderWidget(t,width=300,height=300)

-- 
Martin




More information about the vtkusers mailing list