On 18/09/2003 3:45 AM, Tim Newsham wrote:

[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.  If I do SetRenderWindow(None) on the renderer
    before quitting, I can avoid the crash (seems that the render window
    is destroyed twice during shutdown, once when the physical window
    goes away, and again when the renderer is destroyed).

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?


Does the problem go away if you call "self.set_double_buffered(False)" during the creation of your widget? You are probably running into some problems with GTK's double buffering (you draw onto the window, then GTK blits the contents of a pixmap over the top right after).

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to