X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54b9688254397c48ecf3b911a9b1757b5df76245..5e9ff6adaa0982b43f6fd2b50d72e3639cd521d2:/utils/wxPython/lib/vtk.py 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)