Don't create a dummy dc, instead call GetTextExtend on the pannel itself

This commit is contained in:
cncfanatics
2010-09-04 20:04:32 +02:00
parent 1a9517071e
commit 7458a05802

View File

@@ -41,10 +41,7 @@ class StatsPane(wx.Panel):
self.mainFrame.statsSizer.Layout()
def getTextExtentW(self, text):
tfont=self.GetFont()
mdc=wx.MemoryDC()
mdc.SetFont(tfont)
width, height = mdc.GetTextExtent( text )
width, height = self.GetTextExtent( text )
return width
def fitChanged(self, event):