Configuring properties
The PropertyGrid
control provides a highly customizable, specialized grid to edit name and value pairs. If you have ever used Visual Studio, it's very similar to the Property Editor window. Each named property can be set up with varying types of editor controls in the grid that suits the needs of the specific property's data. This control can be used to create a way to edit configuration values for any sort of data type as well as to view the property information of an item. In this recipe, we will make use of PropertyGrid
to display and edit the attributes of a Python object.
How to do it…
Perform the following steps:
- First, let's set up our module with the necessary imports and class constructor for the custom
PropertyGrid
control, with the following code:import inspect import wx import wx.propgrid as propgrid class ObjectInspector(propgrid.PropertyGrid): def __init__(self, parent): super(ObjectInspector, self).__init__(parent) ...