Don't create a dummy dc, instead call GetTextExtend on the pannel itself
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user