[vtkusers] [wxPython + VTK] bug found in wxVTKRenderWindow.py generating GDK warnings
Benoit Regrain
benoit.regrain at creatis.insa-lyon.fr
Tue Mar 23 10:00:51 EST 2004
Hi,
I have found the bug that generates the following warning when the window isn't immediately visible
(test.py:4677): Gdk-WARNING **: gdkdrawable-x11.c:1012 drawable is not a pixmap or window
This message is visible for RedHat 7.3, RedHat 9.0 and Fedora.
What is the solution :
- When we call the method GetHandle() for an invisible wxWindow, we obtain the precedent message.
Thus, the goal is to report the call when the window will be visible => in the OnPaint method.
So, we remove the call to GetHandle() in the constructor of the wxVTKRenderWindow.
- The OnPaint method calls Render() that searchs if the current handle is good before rendering.
So, in the Render() method, we must test if the window can have an handle. We can call the method GetHandle() in the 2 following cases :
+ If the method is called from the OnPaint, the wx method GetUpdateRegion() will returns a not empty region. So, we will have an handle.
+ If the method is called by the user, the wx method GetUpdateRegion() will returns an empty region. But if the window is visible, we
already have a handle (variable self.__handle != None)
File joined :
- diff between the old and the new wxVTKRenderWindow (after thes modifications)
- a python test file showing the first step (in my solution).
Cheers
-----------------------------------------------------------------
Benoit Regrain
Ingénieur d'études CNRS (Creatis)
email : regrain at creatis.insa-lyon.fr
phone : (+33) (0) 4.72.43.82.58
fax : (+33) (0) 4.72.43.85.26
INSA - Bâtiment Blaise Pascal
7, avenue Jean Capelle
F - 69621 Villeurbanne Cedex
-----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040323/ac417105/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.vtk
Type: application/octet-stream
Size: 1956 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040323/ac417105/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.py
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040323/ac417105/attachment.asc>
More information about the vtkusers
mailing list