]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/mixins/listctrl.py
Patch from FN that fixes bug in RefreshItem on an item that has no
[wxWidgets.git] / wxPython / wx / lib / mixins / listctrl.py
index 09972aa4ea0756ddd0802b63ce28f0268a1f9691..a28a164f793fd2a43b10db1e87ab25923c3fc981 100644 (file)
@@ -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.