]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/mixins/inspect.py
test rendering of disabled items with bitmaps (for bug 1632888)
[wxWidgets.git] / wxPython / wx / lib / mixins / inspect.py
index 782123359ab4b90fb676e0791e30c7b3bc68a945..fc114c597a2d8fd34b7c403a86bee0ee4723e3ea 100644 (file)
@@ -11,8 +11,9 @@
 #----------------------------------------------------------------------------
 
 # NOTE: This class is based on ideas sent to the wxPython-users
-# mail-list by Dan Elof.
+# mail-list by Dan Eloff.
 
+import wx
 import wx.py
 
 class InspectionMixin(object):
@@ -25,13 +26,15 @@ class InspectionMixin(object):
     To use this class simply derive a class from wx.App and
     InspectionMixin and then call the Init() method from the app's
     OnInit.
-    """    
-    def Init(self):
+    """
+    def Init(self, pos=(-1, -1), size=(-1, -1)):
         """
         Make the event binding that will activate the PyCrust window.
         """
         self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress)
         self._crust = None
+        self._pos = pos
+        self._size = size
 
 
     def OnKeyPress(self, evt):
@@ -49,10 +52,10 @@ class InspectionMixin(object):
         Show the PyCrust window.
         """
         if not self._crust:
-            self._crust = wx.py.crust.CrustFrame(self.GetTopWindow())
+            self._crust = wx.py.crust.CrustFrame(self.GetTopWindow(),
+                                                 pos = self._pos, size = self._size)
             self._crust.shell.interp.locals['app'] = self
+            self._crust.shell.interp.locals['wx'] = wx
         win = wx.FindWindowAtPointer()
         self._crust.shell.interp.locals['win'] = win
         self._crust.Show()
-
-