[vtk-developers] New vtk Python packages.
Blezek, Daniel J (CRD)
blezek at crd.ge.com
Mon Oct 8 09:03:18 EDT 2001
Python users,
I really like the new package structure! I think it's a great start to organizing the Python
supporting code for VTK.
> (3) Still haven't decided if we should use interaction or widgets or
> something else for the widget related directories.
I exclusively use Tkinter, so I don't know much about how Python interacts with GTK, etc... But
I'll take a stab at it anyway. In the Tcl world, it's very easy to call the package "interaction"
because Tk is assumed to be the only GUI available. The "vtkinteraction" package helps you set up
bindings, create a simply viewing widget, etc... not much in the way of GUI toolkit widget. In
Python there are many more choices(which I didn't know about). "interaction" doesn't make sense
here, because we are defining much more than interactions with the GUI. We could call it "gui", so I
would use:
from vtk.gui.tkinter import *
# or better
from vtk.gui.tk import *
# and just to have fun
from vtk.gui.gtk import *
# With the "vtk.widget" package
from vtk.widget.tk import *
from vtk.widget.gtk import *
To have a little less clutter, we could use:
from vtk.tk import *
Writing it out, I think I like vtk.gui better. I think that if "gui" isn't the right choice, perhaps
"widget" is better. BTW, I like to keep package names singular, rather than plural, just as a
convention, so I vote for "vtk.test" rather than "vtk.tests", or even better, match TCL with
"vtk.testing".
Hmm, again as I re-read this note, I vote for "vtk.gui.tk", "vtk.gui.gtk", etc...
Later,
-dan
More information about the vtk-developers
mailing list