Allow Py-like reverse indexing of wxList

This commit is contained in:
Mesalu
2018-01-06 02:04:41 -08:00
parent ea4969d782
commit af084599a6

View File

@@ -873,9 +873,12 @@ public:
sipRes = sipCpp->size();
%End
{ItemClass}* __getitem__(ulong index);
{ItemClass}* __getitem__(long index);
%MethodCode
if (index < sipCpp->size()) {{
if (0 > index)
index += sipCpp->size();
if (index < sipCpp->size() && (0 <= index)) {{
{ListClass}::compatibility_iterator node = sipCpp->Item(index);
if (node)
sipRes = ({ItemClass}*)node->GetData();