Select a bitmap in temp memdc

This commit is contained in:
HomeWorld
2010-11-12 16:08:04 +02:00
parent 55276d692a
commit c4ca8dbfea

View File

@@ -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)