From d59efe01ea62f90077c3e43db08bbfbce4f9f544 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 31 Dec 1999 09:34:52 +0000 Subject: [PATCH] Fix for differences of when the ECT_WINDOW_CREATE happens between wxMSW and wxGTK. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxPython/lib/vtk.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/wxPython/lib/vtk.py b/utils/wxPython/lib/vtk.py index c79f15a3ad..eab82b5dc0 100644 --- a/utils/wxPython/lib/vtk.py +++ b/utils/wxPython/lib/vtk.py @@ -35,7 +35,17 @@ class wxVTKRenderWindow(wxScrolledWindow): self.renderWindow = vtkRenderWindow() - EVT_WINDOW_CREATE(self, self.OnCreateWindow) + if wxPlatform != '__WXMSW__': + # We can't get the handle in wxGTK until after the widget + # is created, the window create event happens later so we'll + # catch it there + EVT_WINDOW_CREATE(self, self.OnCreateWindow) + else: + # but in MSW, the window create event happens durring the above + # call to __init__ so we have to do it here. + hdl = self.GetHandle() + self.renderWindow.SetWindowInfo(str(hdl)) + EVT_LEFT_DOWN (self, self.SaveClick) EVT_MIDDLE_DOWN(self, self.SaveClick)