Skip to content

Commit

Permalink
Allow Py-like reverse indexing of wxList
Browse files Browse the repository at this point in the history
  • Loading branch information
mesalu committed Jan 6, 2018
1 parent ea4969d commit af08459
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions etgtools/tweaker_tools.py
Expand Up @@ -873,9 +873,12 @@ class {ListClass}
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();
Expand Down

0 comments on commit af08459

Please sign in to comment.