From 503cad4a4c7718a04aba5af67b235e32528a0c1c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 12 Feb 2007 21:27:09 +0000 Subject: [PATCH] Make the greyed image list be the same size as the main image list, don't assume 16x16 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/lib/customtreectrl.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/wxPython/wx/lib/customtreectrl.py b/wxPython/wx/lib/customtreectrl.py index 87313192a2..e8dffbe598 100644 --- a/wxPython/wx/lib/customtreectrl.py +++ b/wxPython/wx/lib/customtreectrl.py @@ -3958,21 +3958,22 @@ class CustomTreeCtrl(wx.PyScrolledWindow): self._imageListNormal = imageList self._ownsImageListNormal = False self._dirty = True + # Don't do any drawing if we're setting the list to NULL, # since we may be in the process of deleting the tree control. if imageList: self.CalculateLineHeight() - # We gray out the image list to use the grayed icons with disabled items - self._grayedImageList = wx.ImageList(16, 16, True, 0) - - for ii in xrange(imageList.GetImageCount()): - - bmp = imageList.GetBitmap(ii) - image = wx.ImageFromBitmap(bmp) - image = GrayOut(image) - newbmp = wx.BitmapFromImage(image) - self._grayedImageList.Add(newbmp) + # We gray out the image list to use the grayed icons with disabled items + sz = imageList.GetSize(0) + self._grayedImageList = wx.ImageList(sz[0], sz[1], True, 0) + + for ii in xrange(imageList.GetImageCount()): + bmp = imageList.GetBitmap(ii) + image = wx.ImageFromBitmap(bmp) + image = GrayOut(image) + newbmp = wx.BitmapFromImage(image) + self._grayedImageList.Add(newbmp) def SetStateImageList(self, imageList):