From b6517dd41ec46b369bf7d6253bc940320158e494 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 31 Jan 2014 11:31:41 +0000 Subject: [PATCH] BUGFIX: Fixing font selection commands for wxPython. The previous way of selecting fonts was an obsolete hack. Some recent versions of wxPython ran into problems. Now updated to reflect the correct wxPython font selection conventions. Bug report and fix suggestion by S. Dismore. --- gui/Gui/Scytherthread.py | 4 ++-- gui/Gui/Settingswindow.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index dac75b7..2cd5d1a 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -298,7 +298,7 @@ class ResultWindow(wx.Frame): def titlebar(x,title,width=1): txt = wx.StaticText(self,-1,title) - font = wx.Font(14,wx.NORMAL,wx.NORMAL,wx.BOLD) + font = wx.Font(14,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD) txt.SetFont(font) grid.Add(txt,(0,x),(1,width),wx.ALL,10) @@ -376,7 +376,7 @@ class ResultWindow(wx.Frame): rankc = cl.getColour() rankt = cl.getOkay() txt = wx.StaticText(self,-1,rankt) - font = wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD) + font = wx.Font(11,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD) txt.SetFont(font) txt.SetForegroundColour(rankc) grid.Add(txt,(ypos,xpos),(1,1),wx.ALL,10) diff --git a/gui/Gui/Settingswindow.py b/gui/Gui/Settingswindow.py index 507ec7a..5bc5fa9 100644 --- a/gui/Gui/Settingswindow.py +++ b/gui/Gui/Settingswindow.py @@ -57,7 +57,7 @@ class MyGrid(wx.GridBagSizer): self.lineAdd() self.ypos += 1 txt = wx.StaticText(self.parent,-1,title) - font = wx.Font(12,wx.DEFAULT,wx.NORMAL,wx.BOLD) + font = wx.Font(12,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD) txt.SetFont(font) self.Add(txt,pos=(self.ypos,0),span=(1,2),flag=wx.ALIGN_LEFT) self.ypos += 1