wxVTKRenderWindow.py generating GDK warnings
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
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