diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 77ae496ebc..42a787dbe0 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -299,6 +299,15 @@ public: self->GetItem(*info); return info; } + } // The OOR typemaps don't know what to do with the %new, so fix it up. + %pragma(python) addtoclass = " + def GetItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs) + val.thisown = 1 + return val + " + + %addmethods { %new wxPoint* GetItemPosition(long item) { wxPoint* pos = new wxPoint; self->GetItemPosition(item, *pos); diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index c7490103de..46c97a51f1 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -480,6 +480,12 @@ class wxListCtrlPtr(wxControlPtr): return val def __repr__(self): return "" % (self.this,) + + def GetItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs) + val.thisown = 1 + return val + class wxListCtrl(wxListCtrlPtr): def __init__(self,*_args,**_kwargs): self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs)