X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/880715c9a941c58e5f702ff340aac7138b27f6ed..b7aef858828222a05e57671fa01d3cac78aee3ac:/wxPython/src/grid.i diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 51f571f8e4..0d0f37e65b 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -10,7 +10,11 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// -%module grid +%define DOCSTRING +"Classes for implementing a spreadsheet-like control." +%enddef +%module(docstring=DOCSTRING) grid + %{ #include "wx/wxPython/wxPython.h" @@ -1505,7 +1509,7 @@ public: bool operator!=( const wxGridCellCoords& other ) const; %extend { - PyObject* asTuple() { + PyObject* Get() { PyObject* tup = PyTuple_New(2); PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRow())); PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->GetCol())); @@ -1513,9 +1517,10 @@ public: } } %pythoncode { - def __str__(self): return str(self.asTuple()) - def __repr__(self): return 'wxGridCellCoords'+str(self.asTuple()) - def __len__(self): return len(self.asTuple()) + asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") + def __str__(self): return str(self.Get()) + def __repr__(self): return 'wxGridCellCoords'+str(self.Get()) + def __len__(self): return len(self.Get()) def __getitem__(self, index): return self.asTuple()[index] def __setitem__(self, index, val): if index == 0: self.SetRow(val)