Search code examples
wxpythonwxwidgets

Is it possible to expand a FlagsProperty by default in a wxPython PropertyGrid?


Consider this snippet during the initialization of a wxPython window:

pg = wxpg.PropertyGrid(self)
prop = wxpg.FlagsProperty("TestFlags", labels=['A', 'B', 'C'], values=[1, 2, 4])
pg.Append(prop)

Is there anything I could do to pg or prop to force the "TestFlags" property to be expanded when the window is displayed? Likewise I want the minSize of the PropertyGrid window to account for the expanded property.

A scouring of the wxWidgets and wxPython docs has uncovered no attributes or flags that I could mutate to make this happen.


Solution

  • Okay this is actually very easy. The wxPython docs do not report methods that are inherited. I found the correct methods to do what I need (Expand() and ExpandAll()) in the documentation for wx.propgrid.PropertyGridInterface