Do select a bitmap into a memdc

This commit is contained in:
HomeWorld
2010-11-13 23:28:44 +02:00
parent 930e89ebbf
commit 51d5f0976b

View File

@@ -75,10 +75,13 @@ class PFTabRenderer:
return self.CopyRegion(self.closeBtnRegion)
def GetMinSize(self):
ebmp = wx.EmptyBitmap(1,1)
mdc = wx.MemoryDC()
mdc.SelectObject(ebmp)
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)