Re: [pygtk] gtk+vtk again

2003-09-19 Thread Christian Reis

John, why don't you post this project somewhere on the Web, or see if
James isn't interested in integrating your code? I can't put it inside
the FAQ, and it's a shame to only have a pointer to it in a mailist list
archive.

Take care,
--
Christian Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] gtk+vtk again

2003-09-18 Thread Tim Newsham
> 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).

To follow up for the benefit of the list and list archive -- John 
Hunter gave me a more recent versions of:

   GtkGLExtVTKRenderWindowInteractor.py

and it does not have the refresh or shutdown-crash problems I mentioned
when I run it in win32.

Tim N.

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


Re: [pygtk] gtk+vtk again

2003-09-17 Thread James Henstridge
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/


Re: [pygtk] gtk+vtk again

2003-09-17 Thread John Hunter

> "Tim" == Tim Newsham <[EMAIL PROTECTED]> writes:

Tim> I just did.  It "mostly" works

I have written a gtk render window and render window interactor based
on Prabu's original to work with pygkt-1.99.16+ with the Lueb patch
and gtkglext.  I haven't tested it yet with pygtk-2.0 which
incorporates the patch.  I think in that version there are not
different names for hwnd and xid, but haven't had time to take a close
look



GtkGLExtVTKRenderWindow.py
Description: Binary data


GtkGLExtVTKRenderWindowInteractor.py
Description: Binary data

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


[pygtk] gtk+vtk again

2003-09-17 Thread Tim Newsham

[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?

Tim N.


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