[vtkusers] vtkRenderer in wxPython

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Mon Nov 19 11:33:48 EST 2001


>>>>> "JH" == John Hunter <jdhunter at ace.bsd.uchicago.edu> writes:

    JH> I am trying to port the SliceViewer.py demo code that ships
    JH> with vtk3.2 in contrib/examplesPython to wxPython, in part
    JH> because I need the functionality and in part because I am
    JH> trying to learn how to integrate vtk with wxPython.

    JH> My current problem is that the vtkRenderer appears to default
    JH> to an X (Tk?)  window because my test app is creating two
    JH> windows: my wxPython window (titled "John's VTK" and another X
    JH> window (titled "SliceViewer").  The SliceViewer window
    JH> contains the image and all the functionality that I want in my
    JH> wxFrame.

I havent looked at your code for lack of time but I thought I'd
mention that you should ensure that renwin.Render() is *never* called
before your wxVTK widget is _realized_.  If this ever happens your VTK
window will not be embedded inside your wx widget.  In other words,
you must call renwin.Render() only after you have shown the wxVTK
widget on screen.  I suspect that this might the source of your
problem.

BTW, did you notice the expose related problems with wxPython.lib.vtk
that I mentioned in my last email?

prabhu



More information about the vtkusers mailing list