I have subclassed some properties to add custom data to them that I need to use in my event handlers. The implementations are simple, i.e.:
class myIntProperty(wxpg.PyIntProperty):
def init(self, par):
self.par = par
label = self.par.symbolname
wxpg.PyIntProperty.init(self, label, label, 0)
I append properties of this kind to my PropertyGrid but in the event handlers and when I use iterators on the PropertyGrid i get objects of type PGProperty which lacks my custom data.
def PropertyChanged(self, event):
p = event.GetProperty()
print p
results in: <wx.propgrid.PGProperty; proxy of <Swig Object of type ‘wxPGProperty *’ at 0x256d758> >
In this case p.par does not exist. Is there something obvious I’m missing here?