From: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - 2007-11-12 13:36:32
|
On 11/11/2007 21:46, Ray Allen wrote: > Is it possible for the textarea component to display multiple fonts? I'd > like certain keywords to be displayed in another colour. You could delve into the underlying wxPython and use SetStyle(): text = self.components.MyTextArea text.text = "This is a sample piece of text, with sample in reversed text and text in Roman bold." reverseAttr = wx.TextAttr("white","black") text.SetStyle(10,16,reverseAttr) text.SetStyle(37,43,reverseAttr) romanAttr = wx.TextAttr("black",wx.NullColour,wx.Font(text.GetFont().GetPointSize(), wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) text.SetStyle(26,30,romanAttr) text.SetStyle(56,60,romanAttr) text.SetStyle(65,69,romanAttr) Any use? -- XXXXXXXXXXX |