Phoenix Logo

phoenix_title wx.lib.mixins.inspection.InspectionMixin

This class is intended to be used as a mix-in with the App. When used it will add the ability to popup a InspectionFrame window where the widget under the mouse cursor will be selected in the tree and loaded into the shell’s namespace as ‘obj’. The default key sequence to activate the inspector is Ctrl-Alt-I (or Cmd-Alt-I on Mac) but this can be changed via parameters to the Init method, or the application can call ShowInspectionTool from other event handlers if desired.

To use this class simply derive a class from App and InspectionMixin and then call the InspectionMixin.Init method from the app’s AppConsole.OnInit method.


class_hierarchy Class Hierarchy

Inheritance diagram for class InspectionMixin:

method_summary Methods Summary

InitInspection Make the event binding that will activate the InspectionFrame window.
ShowInspectionTool Show the Inspection tool, creating it if neccesary, setting it

api Class API



class InspectionMixin(object)

This class is intended to be used as a mix-in with the App. When used it will add the ability to popup a InspectionFrame window where the widget under the mouse cursor will be selected in the tree and loaded into the shell’s namespace as ‘obj’. The default key sequence to activate the inspector is Ctrl-Alt-I (or Cmd-Alt-I on Mac) but this can be changed via parameters to the Init method, or the application can call ShowInspectionTool from other event handlers if desired.

To use this class simply derive a class from App and InspectionMixin and then call the InspectionMixin.Init method from the app’s AppConsole.OnInit method.


Methods



InitInspection(self, pos=wx.DefaultPosition, size=wx.Size(850, 700), config=None, locals=None, alt=True, cmd=True, shift=False, keyCode=ord('I'))

Make the event binding that will activate the InspectionFrame window.

Parameters:
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • config – A Config object to be used to store layout and other info to when the inspection frame is closed. This info will be restored the next time the inspection frame is used.
  • locals – A dictionary of names to be added to the PyCrust namespace.
  • alt (boolean) – use alt in the short cut sequence
  • cmd (boolean) – use ctrl/cmd in the short cut sequence
  • shift (boolean) – use shift in the short cut sequence
  • keyCode (string) – the key code for the short cut sequence


ShowInspectionTool(self)

Show the Inspection tool, creating it if neccesary, setting it to display the widget under the cursor.