From: Robin Dunn Date: Wed, 22 Oct 2003 23:29:54 +0000 (+0000) Subject: Added SetColumnCount method X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c85417f62984016f7030f322fd9d6f83c5b2fc54?ds=inline Added SetColumnCount method git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wxPython/lib/mixins/listctrl.py b/wxPython/wxPython/lib/mixins/listctrl.py index c422c17cad..029994a8c9 100644 --- a/wxPython/wxPython/lib/mixins/listctrl.py +++ b/wxPython/wxPython/lib/mixins/listctrl.py @@ -40,15 +40,18 @@ class wxColumnSorterMixin: """ def __init__(self, numColumns): - self._colSortFlag = [0] * numColumns - self._col = -1 - + self.SetColumnCount(numColumns) list = self.GetListCtrl() if not list: raise ValueError, "No wxListCtrl available" EVT_LIST_COL_CLICK(list, list.GetId(), self.__OnColClick) + def SetColumnCount(self, newNumColumns): + self._colSortFlag = [0] * newNumColumns + self._col = -1 + + def SortListItems(self, col=-1, ascending=1): """Sort the list on demand. Can also be used to set the sort column and order.""" oldCol = self._col