How do I set t开发者_Python百科he font on a wxPython StaticText widget?
use object.SetFont. For example (from wxpython in Action):
text = wx.StaticText(panel, -1, 'my text', (20, 100))
font = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.NORMAL)
text.SetFont(font)
wx.Font has the following signature:
wx.Font(pointSize, family, style, weight, underline=False, faceName="", encoding=wx.FONTENCODING_DEFAULT)
family can be:
wx.DECORATIVE, wx.DEFAULT,wx.MODERN, wx.ROMAN, wx.SCRIPT or wx.SWISS.
style can be:
wx.NORMAL, wx.SLANT or wx.ITALIC.
weight can be:
wx.NORMAL, wx.LIGHT, or wx.BOLD
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论