From af084599a6202c57380ff31f577a2fc6d76ded15 Mon Sep 17 00:00:00 2001 From: Mesalu Date: Sat, 6 Jan 2018 02:04:41 -0800 Subject: [PATCH] Allow Py-like reverse indexing of wxList --- etgtools/tweaker_tools.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etgtools/tweaker_tools.py b/etgtools/tweaker_tools.py index f4397cd6..7f57c340 100644 --- a/etgtools/tweaker_tools.py +++ b/etgtools/tweaker_tools.py @@ -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();