[vtkusers] gtk + vtk again..

Tim Newsham newsham at lava.net
Wed Sep 10 19:04:32 EDT 2003


[In a blast from the past, John Hunter said...]
> BTW Prabu, the Lueb patch also exposes the hwnd attribute for win32
> systems, which I think is the analog of the xid attribute.  Hence it
> should be possible to port the GtkVTKRenderWindow code to win32 with
> the patched pygtk2.  
> 
> Something like
> 
>     def OnRealize(self, *args):
>         if self.__Created == 0:
>             # you can't get the xid without the window being realized.
>             self.realize()
>             if sys.platform=='win32':
>               win_id = str(self.get_window().hwnd)
>             else:
>               win_id = str(self.get_window().xid)
>             self._RenderWindow.SetWindowInfo(win_id)
>             self.__Created = 1
>         return gtk.TRUE
> 
> I haven't been able to test this yet.
>
> John Hunter

I just did.  It "mostly" works

   - When the gui first comes up you see some flickering, the background
     gray shows through, then the black render window pops over it and
     then the gray shows through once again.
   - If I start interacting in the render window, the black render window
     shows through again.
   - If the window loses focus, the grey backdrop is once again painted
     over the rendered data.
   - when I quit, the program crashes (that is, the python binary)
     during shutdown.

I'm no windows gui expert or gtk+ expert, but I'll probably try to
bang my head against this anyway.  If anyone has helpful pointers,
they would be appreciated.

Btw.. why not expose the "xid" and "hwnd" variables under the same
name if their values are used in nearly interchangeable ways?

Tim N.




More information about the vtkusers mailing list