本文整理汇总了Python中wx.FONTWEIGHT_LIGHT属性的典型用法代码示例。如果您正苦于以下问题:Python wx.FONTWEIGHT_LIGHT属性的具体用法?Python wx.FONTWEIGHT_LIGHT怎么用?Python wx.FONTWEIGHT_LIGHT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类wx
的用法示例。
在下文中一共展示了wx.FONTWEIGHT_LIGHT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: draw_monitor_sizes
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTWEIGHT_LIGHT [as 别名]
def draw_monitor_sizes(self):
font = wx.Font(24, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_LIGHT)
font_clr = wx.Colour(60, 60, 60, alpha=wx.ALPHA_OPAQUE)
for st_bmp, img_sz, dsp in zip(self.preview_img_list,
self.img_rel_sizes,
self.display_sys.disp_list):
bmp = st_bmp.GetBitmap()
dc = wx.MemoryDC(bmp)
text = str(dsp.diagonal_size()[1]) + '"'
dc.SetTextForeground(font_clr)
dc.SetFont(font)
# bmp_w, bmp_h = dc.GetSize()
bmp_w, bmp_h = img_sz
text_w, text_h = dc.GetTextExtent(text)
pos_w = bmp_w - text_w - 5
pos_h = 5
dc.DrawText(text, pos_w, pos_h)
del dc
st_bmp.SetBitmap(bmp)
示例2: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import FONTWEIGHT_LIGHT [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((400, 300))
self.SetTitle("frame")
sizer_1 = wx.BoxSizer(wx.VERTICAL)
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "Some Input", style=wx.TE_READONLY)
self.text_ctrl_1.SetBackgroundColour(wx.Colour(0, 255, 127))
self.text_ctrl_1.SetForegroundColour(wx.Colour(255, 0, 0))
self.text_ctrl_1.SetFont(wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
self.text_ctrl_1.SetFocus()
sizer_1.Add(self.text_ctrl_1, 1, wx.ALL | wx.EXPAND, 5)
label_1 = wx.StaticText(self, wx.ID_ANY, "label_1")
sizer_1.Add(label_1, 0, 0, 0)
label_2 = wx.StaticText(self, wx.ID_ANY, "label_2")
label_2.SetFont(wx.Font(8, wx.FONTFAMILY_DECORATIVE, wx.FONTSTYLE_SLANT, wx.FONTWEIGHT_LIGHT, 0, ""))
sizer_1.Add(label_2, 0, 0, 0)
label_3 = wx.StaticText(self, wx.ID_ANY, "label_3")
label_3.SetFont(wx.Font(8, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_ITALIC, wx.FONTWEIGHT_BOLD, 0, ""))
sizer_1.Add(label_3, 0, 0, 0)
label_4 = wx.StaticText(self, wx.ID_ANY, "label_4")
label_4.SetFont(wx.Font(8, wx.FONTFAMILY_SCRIPT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
sizer_1.Add(label_4, 0, 0, 0)
label_5 = wx.StaticText(self, wx.ID_ANY, "label_5")
label_5.SetFont(wx.Font(10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 0, ""))
sizer_1.Add(label_5, 0, 0, 0)
label_6 = wx.StaticText(self, wx.ID_ANY, "label_6")
label_6.SetFont(wx.Font(12, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, 1, ""))
sizer_1.Add(label_6, 0, 0, 0)
self.SetSizer(sizer_1)
self.Layout()
# end wxGlade
# end of class MyFrame