[vtkusers] RE: [wxPython] VTK + wxPython flicker issue on Linux/GTK.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri Mar 9 06:22:15 EST 2001


hi,

This is the promised update on the flicker issue with wxPython + VTK
on Linux with GTK.

In the earlier message I indicated that the C++ class wxVTKWindow
works fine when one changes the references to WindowId to ParentId.
As regards the Python code, the vtk.py shipped with wxPython sets the
WindowId by calling the wrapped function SetWindowInfo(char *) like
so:

        hdl = self.GetHandle()
        self.renderWindow.SetWindowInfo(str(hdl))

Since the flicker in the c++ class vanished when I used ParentId
instead of WindowId I proposed to add a new function called
SetParentInfo to the vtk classes.  I just did that and recompiled the
libVTKGraphics.so and libVTKGraphicsPython.so.  Then I changed the
wxPython/lib/vtk.py file to use this new function like so:

        hdl = self.GetHandle()
        self.renderWindow.SetParentInfo(str(hdl))

I am thrilled to say it now works like a charm!  No more flicker!!  I
also added an OnSize method to make the size change properly.  I guess
when I get a little more familiar with wxPython I will send in an
improved wxVTKRenderWindow class.

I did notice a silly problem with all the wxPython demos.  All of the
widgets do not seem to redraw on an expose event.  Is this a known
bug??

Meanwhile, I will send the VTK patches to the VTK list separately and
hope that the stuff gets added to both the CVS tree and also the
3.2beta branch.

Now there is nothing stopping me from learning wxPython properly!!

Thanks for all the help and patient listening. :)

regards,
prabhu




More information about the vtkusers mailing list