From c4ca8dbfea69937445254f03a5eea7e86b5179a8 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Fri, 12 Nov 2010 16:08:04 +0200 Subject: [PATCH] Select a bitmap in temp memdc --- miniframe.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/miniframe.py b/miniframe.py index 3f600b16c..cb4ffdb35 100755 --- a/miniframe.py +++ b/miniframe.py @@ -66,10 +66,15 @@ class PFTabRenderer: return self.CopyRegion(self.closeBtnRegion) def GetMinSize(self): + tbmp = wx.EmptyBitmap(1,1) mdc = wx.MemoryDC() + mdc.SelectObject(tbmp) + mdc.SetFont(self.font) textSizeX, textSizeY = mdc.GetTextExtent(self.text) totalSize = self.lrZoneWidth * 2 + textSizeX + self.cbSize*2 if self.closeButton else 0 + + mdc.SelectObject(wx.NullBitmap) return (totalSize, self.tabHeight)