Change the colour of a StaticText, wxPython

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

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

3条回答
  •  抹茶落季
    2021-01-07 18:40

    This should work:

    text.SetForegroundColour(wx.Colour(255,255,255))
    

    If you are using it inside the panel or frame's class then:

    self.text.SetForegroundColour(wx.Colour(255,255,255))
    

    wx.Colour takes RGB values which can be used for different colours.

提交回复
热议问题