[vtkusers] Gtk/wx and VTK - more issues: need help!

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Mar 10 09:09:25 EST 2001


hi,

Here are some new problems I ran into while trying to create a pyGtk
widget with an embedded VTK widget.

  (1) If I set the ParentId of the vtkRenderWindow using SetParentInfo
  the flicker is removed but now there is a new problem, the window
  does not generate expose events properly.  Therefore, if you put
  another window on top of this window and move the top window the
  embedded vtk window is not redrawn because it doesnt generate an
  expose event.  A resize of the widget however generates an expose
  event.  This happens with both wxPython, the wxVTKWindow c++ class
  and also with my simple GTK + Python class.  If I set the WindowId
  using WindowInfo the expose event works but there is a huge amount
  of flicker as mentioned before.  I ran xev on this and found that as
  expected when the embedded widget is obscured and then un-obscured
  there is no expose event generated but a visibilitynotify event and
  by capturing this and generating a redraw things work fine.

  However, I dont understand why this happens - can any X guru
  enlighten me out here?  This might be a GTK problem too.  My
  version of GTK is 1.2.8.

  (2) While embedding a vtk window into a gtk widget I first tried
  with a vtkRenderWindow() and I was able to embed the window
  properly.  However, when I tried to use a vtkRenderWindowInteractor
  and use that instead, the vtkRenderWindow simply refuses to become
  embedded in the Gtk Widget.  I suspect that this happens because
  Render() is called before the Gtk window is realized.  Is there a
  way out of this?

Oh, BTW if there are any pyGtk lovers there looking for a start with
embedding VTK and GTK, please let me know.  I know practically no GTK
and am bumbling with it quite a bit. However, I have successfully
managed to embed a vtkRenderWindow into a GtkDrawingArea.  I havent
added the mouse based stuff yet...

thanks,
prabhu




More information about the vtkusers mailing list