Updates from Dan
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
# NOTE: This class is based on ideas sent to the wxPython-users
|
# NOTE: This class is based on ideas sent to the wxPython-users
|
||||||
# mail-list by Dan Elof.
|
# mail-list by Dan Eloff.
|
||||||
|
|
||||||
import wx.py
|
import wx.py
|
||||||
|
|
||||||
@@ -25,13 +25,15 @@ class InspectionMixin(object):
|
|||||||
To use this class simply derive a class from wx.App and
|
To use this class simply derive a class from wx.App and
|
||||||
InspectionMixin and then call the Init() method from the app's
|
InspectionMixin and then call the Init() method from the app's
|
||||||
OnInit.
|
OnInit.
|
||||||
"""
|
"""
|
||||||
def Init(self):
|
def Init(self, pos=(-1, -1), size=(-1, -1)):
|
||||||
"""
|
"""
|
||||||
Make the event binding that will activate the PyCrust window.
|
Make the event binding that will activate the PyCrust window.
|
||||||
"""
|
"""
|
||||||
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress)
|
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress)
|
||||||
self._crust = None
|
self._crust = None
|
||||||
|
self._pos = pos
|
||||||
|
self._size = size
|
||||||
|
|
||||||
|
|
||||||
def OnKeyPress(self, evt):
|
def OnKeyPress(self, evt):
|
||||||
@@ -49,10 +51,9 @@ class InspectionMixin(object):
|
|||||||
Show the PyCrust window.
|
Show the PyCrust window.
|
||||||
"""
|
"""
|
||||||
if not self._crust:
|
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['app'] = self
|
||||||
win = wx.FindWindowAtPointer()
|
win = wx.FindWindowAtPointer()
|
||||||
self._crust.shell.interp.locals['win'] = win
|
self._crust.shell.interp.locals['win'] = win
|
||||||
self._crust.Show()
|
self._crust.Show()
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user