I need to make a StaticText red, what should I use?
我正在研究一个名为“智者”的模拟活动。 (项目链接) 什么是视觉模拟的好工具? 视像应包括简单物体......
I need to make a StaticText red, what should I use?
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()
Depending on which color you would need to set, look into SetForegroundColour()
or SetBackgroundColour()
method.
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.
我正在研究一个名为“智者”的模拟活动。 (项目链接) 什么是视觉模拟的好工具? 视像应包括简单物体......
I was trying to get my first wxWindow application to work and I ran into following difficulty: I create wxPanel and add a wxNotebook object to it. Then I add a page to notebook created from another ...
I have a timer, and need to know if any of the keys is pressed on any cycle. How do I do it?
I need to make a StaticText red, what should I use?
Here is my current code (language is Python): newFrameImage = cv.QueryFrame(webcam) newFrameImageFile = cv.SaveImage("temp.jpg",newFrameImage) wxImage = wx.Image("temp.jpg", wx.BITMAP_TYPE_ANY)....
I am creating a ToolBar within a wx.Frame init and setting the help string as follows: def __init_(self,...): ... self.CreateStatusBar() tb = self.CreateToolBar(wx.TB_HORIZONTAL|wx.NO_BORDER|...
Screenshot I m looking to recreate this in Python; I can t find a library that seems to have what I need. Are there any GUI libraries that might possibly have this? - I have scoured wxWidgets (which ...
In a wxPython application I m developing I need a lot of input fields for numbers (integers and floats), so I tried using wx.lib.masked.NumCtrl, but my users now tell me that it s quite uncomfortable ...