Propgrid: Iterator and event handler just returns objects of type wx.propgrid.PGProperty, not my custom property type

19 views
Skip to first unread message

John S

unread,
Aug 10, 2016, 12:03:48 PM8/10/16
to wxPython-users
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?
Reply all
Reply to author
Forward
0 new messages