wx.TextCtrl设置字体颜色
QQ群:476842922(欢迎加群讨论学习)
import wx
value1 = "Shine bright like a diamond\n"
value2 ="In the beautiful sea\n"
app = wx.App()
win = wx.Frame(None,title='MY TEST',size=(600,700))
text = wx.TextCtrl(win,style = wx.TE_MULTILINE|wx.TE_WORDWRAP|wx.TE_READONLY|wx.TE_RICH2)
text.SetDefaultStyle(wx.TextAttr(wx.RED))
text.AppendText(value1)
text.AppendText(value2)
win.Show()
app.MainLoop()