X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0eae5d09992c634488c5be14d5a378d6e1dedb71..203bfdca0c885d6ac295e4ffea1c95d80fe75b85:/wxPython/src/_control.i diff --git a/wxPython/src/_control.i b/wxPython/src/_control.i index 9ecfec7c4f..d755d75270 100644 --- a/wxPython/src/_control.i +++ b/wxPython/src/_control.i @@ -277,6 +277,23 @@ is selected.", ""); slightly more natural for controls which support multiple selection.", ""); + %pythoncode { + def GetItems(self): + """Return a list of the strings in the control""" + return [self.GetString(i) for i in xrange(self.GetCount())] + + def SetItems(self, items): + """Clear and set the strings in the control from a list""" + self.Clear() + for i in items: + self.Append(i) + } + + %property(Count, GetCount, doc="See `GetCount`"); + %property(Items, GetItems, SetItems, doc="See `GetItems` and `SetItems`"); + %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`"); + %property(StringSelection, GetStringSelection, SetStringSelection, doc="See `GetStringSelection` and `SetStringSelection`"); + %property(Strings, GetStrings, doc="See `GetStrings`"); };