vtkmodules.gtk.GtkVTKRenderWindowInteractor#

Description:

Provides a pyGtk vtkRenderWindowInteractor widget. This embeds a vtkRenderWindow inside a GTK widget and uses the vtkGenericRenderWindowInteractor for the event handling. This is based on vtkTkRenderWindow.py.

The class uses the gtkgl.GtkGLArea widget (gtkglarea). This avoids a lot of problems with flicker.

There is a working example at the bottom.

Created by Prabhu Ramachandran, April 2002.

Bugs:

(*) There is a focus related problem. Tkinter has a focus object that handles focus events. I don’t know of an equivalent object under GTK. So, when an ‘enter_notify_event’ is received on the GtkVTKRenderWindow I grab the focus but I don’t know what to do when I get a ‘leave_notify_event’.

(*) Will not work under Win32 because it uses the XID of a window in OnRealize. Suggestions to fix this will be appreciated.

Module Contents#

Classes#

GtkVTKRenderWindowInteractor

Embeds a vtkRenderWindow into a pyGTK widget and uses vtkGenericRenderWindowInteractor for the event handling. This class embeds the RenderWindow correctly. A getattr hook is provided that makes the class behave like a vtkGenericRenderWindowInteractor.

Functions#

API#

class vtkmodules.gtk.GtkVTKRenderWindowInteractor.GtkVTKRenderWindowInteractor(*args)#

Bases: gtkgl.GtkGLArea

Embeds a vtkRenderWindow into a pyGTK widget and uses vtkGenericRenderWindowInteractor for the event handling. This class embeds the RenderWindow correctly. A getattr hook is provided that makes the class behave like a vtkGenericRenderWindowInteractor.

Initialization

set_usize(w, h)#
ConnectSignals()#
__getattr__(attr)#

Makes the object behave like a vtkGenericRenderWindowInteractor

CreateTimer(obj, event)#
DestroyTimer(obj, event)#

The timer is a one shot timer so will expire automatically.

GetRenderWindow()#
Render()#
OnRealize(*args)#
OnConfigure(wid, event=None)#
OnExpose(*args)#
OnDestroy(event=None)#
_GetCtrlShift(event)#
OnButtonDown(wid, event)#

Mouse button pressed.

OnButtonUp(wid, event)#

Mouse button released.

OnMouseMove(wid, event)#

Mouse has moved.

OnEnter(wid, event)#

Entering the vtkRenderWindow.

OnLeave(wid, event)#

Leaving the vtkRenderWindow.

OnKeyPress(wid, event)#

Key pressed.

OnKeyRelease(wid, event)#

Key released.

Initialize()#
vtkmodules.gtk.GtkVTKRenderWindowInteractor.main()#