Changing the font on a wxPython TextCtrl widget

rectangletangle picture rectangletangle · May 2, 2011 · Viewed 10.1k times · Source

I'd like to set the font of a wx.TextCtrl widget to Consolas, or at least another monospaced font. How would I go about this?

Answer

Stephen Terry picture Stephen Terry · May 2, 2011
font1 = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas')
myTextCtrl.SetFont(font1)