From 0fecb90eb162e22c444b72bdbfc594821f440abe Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 21 Feb 2017 12:43:10 -0800 Subject: [PATCH] Give wxPGChoices some sequence special methods --- etg/propgridproperty.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etg/propgridproperty.py b/etg/propgridproperty.py index 057b5755..93340500 100644 --- a/etg/propgridproperty.py +++ b/etg/propgridproperty.py @@ -77,6 +77,15 @@ def run(): tools.ignoreConstOverloads(c) c.find('operator[]').ignore() + c.addPyMethod('__getitem__', '(self, index)', + doc="Returns a reference to a :class:PGChoiceEntry using Python list syntax.", + body="return self.Item(index)", + ) + c.addPyMethod('__len__', '(self)', + doc="", + body="return self.GetCount()", + ) + # Ignore some string constants (#defines) coming from dox, and add them # back in Python code. They are wchar_t* values and this seemed the # simplest way to deal with them.