Inspection tool hot key sequence doesn't work- Inspection tool is inspecting itself, not the target app

I've added the code from here
http://wiki.wxpython.org/Widget%20Inspection%20Tool

to my app, below

but can't seem to make the inspection tool popup when i press Ctrl-Alt-
I
Also- the inspector is inspecting itself, not the target app.

Is anyone else having these problems?

import wx.lib.mixins.inspection

class App(wx.App, wx.lib.mixins.inspection.InspectionMixin):

   def OnInit(self):
      self.Init() # initialize the inspection tool
      self.frame = MyFrame()
      self.frame.Show()
      wx.lib.mixins.inspection.InspectionTool().Show()
      self.SetTopWindow(self.frame)
      return True

app = App()
app.MainLoop()

I've added the code from here
http://wiki.wxpython.org/Widget%20Inspection%20Tool

to my app, below

but can't seem to make the inspection tool popup when i press Ctrl-Alt-
I
Also- the inspector is inspecting itself, not the target app.

It will show all the top level windows in the app at the time the inspector is shown (or when its refresh button is pressed.) Since the inspector is one of those windows then it will be in the list.

Is anyone else having these problems?

import wx.lib.mixins.inspection

class App(wx.App, wx.lib.mixins.inspection.InspectionMixin):

    def OnInit(self):
       self.Init() # initialize the inspection tool
       self.frame = MyFrame()
       self.frame.Show()
       wx.lib.mixins.inspection.InspectionTool().Show()
       self.SetTopWindow(self.frame)
       return True

app = App()
app.MainLoop()

Does the hotkey work if you don't do the InspectionTool().Show() in OnInit? Do you have anything in the rest of the application that is eating all the key events? The hotkey is managed by looking at the key events that make it to the app object. If the widget with the focus is taking all of the key events without Skip()ing then the app won't get the events so it won't be able to open the inspector.

···

On 12/14/09 11:30 AM, cappy2112 wrote:

--
Robin Dunn
Software Craftsman