-        # Activate the widget inspector that was mixed in with the
-        # app, see MyApp and MyApp.OnInit below.
-        wx.GetApp().ShowInspectionTool()
+        # Activate the widget inspection tool
+        from wx.lib.inspect import InspectionTool
+        if not InspectionTool().initialized:
+            InspectionTool().Init()
+
+        # Find a widget to be selected in the tree.  Use either the
+        # one under the cursor, if any, or this frame.
+        wnd = wx.FindWindowAtPointer()
+        if not wnd:
+            wnd = self
+        InspectionTool().Show(wnd, True)