Change the colour of a StaticText, wxPython

后端 未结 3 373
一整个雨季
一整个雨季 2021-01-07 17:59

I need to make a StaticText red, what should I use?

3条回答
  •  走了就别回头了
    2021-01-07 18:40

    Here it is

    import wx
    
    app=wx.PySimpleApp()
    frame=wx.Frame(None)
    text=wx.StaticText(frame, label="Colored text")
    text.SetForegroundColour((255,0,0)) # set text color
    text.SetBackgroundColour((0,0,255)) # set text back color
    frame.Show(True)
    app.MainLoop()
    

提交回复
热议问题