X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9f4cc34f375fbff74006f3057e90dd01c426f580..d1b736b7968ceea4233f3fceecdb01173f68a9a3:/wxPython/wx/lib/mixins/listctrl.py?ds=inline diff --git a/wxPython/wx/lib/mixins/listctrl.py b/wxPython/wx/lib/mixins/listctrl.py index 09972aa4ea..a28a164f79 100644 --- a/wxPython/wx/lib/mixins/listctrl.py +++ b/wxPython/wx/lib/mixins/listctrl.py @@ -117,8 +117,18 @@ class ColumnSorterMixin: self._col = col = evt.GetColumn() self._colSortFlag[col] = int(not self._colSortFlag[col]) self.GetListCtrl().SortItems(self.GetColumnSorter()) - self.__updateImages(oldCol) + if wx.Platform != "__WXMAC__" or wx.SystemOptions.GetOptionInt("mac.listctrl.always_use_generic") == 1: + self.__updateImages(oldCol) evt.Skip() + self.OnSortOrderChanged() + + + def OnSortOrderChanged(self): + """ + Callback called after sort order has changed (whenever user + clicked column header). + """ + pass def __ColumnSorter(self, key1, key2): @@ -248,6 +258,9 @@ class ListCtrlAutoWidthMixin: if not self: # avoid a PyDeadObject error return + + if self.GetSize().height < 32: + return # avoid an endless update bug when the height is small. numCols = self.GetColumnCount() if numCols == 0: return # Nothing to resize.