[vtkusers] GUI for VTK (was [DEMO] amira)
David Gobbi
dgobbi at irus.rri.on.ca
Wed Jun 14 11:03:46 EDT 2000
Hi Jorrit,
We are developing an abstract GUI-interface for python, but so far
it only works for event binding and not for buttons, frames or menus.
Basically, a Python data structure holds the bindings between the
events and the callback functions.
Event binding is done Tk-style (it is one of the parts of Tk I don't hate)
pane.BindEvent("<B1-Motion>",callback)
and the event class itself has the same attributes (e.x, e.y, etc.)
as a Tkinter event. So all you have to do is convert a wx, MFC, etc.
event into a Tkinter-style event object and pass it to the GUI-independent
event handler for the application:
app.HandleEvent(e)
In this way, when we finally switch away from Tk all we have to do is
write a new vtkRenderWidget that does the event conversion and all our
code will work as-is. Doing the event handling in Python doesn't appear
to slow things down at all, Python dictionaries (i.e. hash tables) are
easy to use and extremely efficient.
- David
--
David Gobbi, MSc dgobbi at irus.rri.on.ca
Advanced Imaging Research Group
Robarts Research Institute, University of Western Ontario
On Wed, 14 Jun 2000, Jorrit Schaap wrote:
> > => my favorite "candidate" is wxWindows : http://www.wxwindows.org/, but
> > I've NOT been playing with it for the moment. It looks serious, and seems
> > easy to install. "It'a free C++ framework supporting Windows 3.1/95/98/NT,
> > and Unix with GTK/Motif/Lesstif. A Mac port at version 2.0 is available.
> > Other ports are under consideration." It has Python support :
> > http://wxpython.org/.
> >
> > I guess we should compare Tk and wxWindows, it's worth a try. There is one
> > big issue to solve : I do not know if there is an OpenGL support in
> > wxWindows, or if we need to develop something like a TkRenderWidget or
> > tkImageWidget for wxWindows...
>
> wxWindows is my favorite as well ! I started to work with it about a week ago, and i love it.
> It's simple, intuitive programming, so much better than MFC (understatement of the century). As
> far as the OpenGL support, it's there. I made a little programm, in which I assign the
> vtkRenderWindow the windowHandle of a wxFrame, and it worked, resizing, rendering, everything!
>
> One disadvantage though, it's difficult to incorporate the wx GUI in an existing application. I
> have an existing MFC application (written by others). My piece is the 3D visualization part,
> incluiding a GUI. I didn't figure out how to get the two working together, but I'm sure its
> possible. Maybe somebody in the mailing list knows?
>
>
> > Just my 2 cents. Feel free to flame :)
>
> No need to flame. you wrote a great mail.
>
> Jorrit
More information about the vtkusers
mailing list