]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/mixins/listctrl.py
wxFile::Length() return type fix (replaces last check in)
[wxWidgets.git] / wxPython / wx / lib / mixins / listctrl.py
index ddbb8b46a073274056d67568e5c046d8e79dbe22..77e49112de0f40f8e06c2a3c3d1a9dbbeaf1ef27 100644 (file)
@@ -216,6 +216,10 @@ class ListCtrlAutoWidthMixin:
             or calculated a minimum width.  This ensure that repeated calls to
             _doResize() don't cause the last column to size itself too large.
         """
+        
+        if not self:  # avoid a PyDeadObject error
+            return
+        
         numCols = self.GetColumnCount()
         if numCols == 0: return # Nothing to resize.
 
@@ -258,7 +262,7 @@ def selectBeforePopup(event):
 
     Works with both single-select and multi-select lists."""
     ctrl = event.GetEventObject()
-    if isinstance(ctrl, wxListCtrl):
+    if isinstance(ctrl, wx.ListCtrl):
         n, flags = ctrl.HitTest(event.GetPosition())
         if n >= 0:
             if not ctrl.GetItemState(n, wx.LIST_STATE_SELECTED):