Python 2.7.3 x64 wxPython 2.8 x64
我无法更改 wxpython 消息对话框的字体。我想使用固定宽度的字体(我认为 wxFAMILY_MODERN 是)来控制输出的格式。这是我用来测试的代码......
def infDialog (self, msg, title):
""" Display Info Dialog Message """
font = wx.Font(14, wx.MODERN, wx.NORMAL, wx.NORMAL)
style = wx.OK | wx.ICON_INFORMATION | wx.STAY_ON_TOP
dialog = wx.MessageDialog(self, msg, title, style)
dialog.CenterOnParent()
dialog.SetFont(font)
result = dialog.ShowModal()
if result == wx.ID_OK:
print dialog.GetFont().GetFaceName()
dialog.Destroy()
return
# End infDialog()
但是当我单击确定时的结果总是“Arial”。有什么想法吗?也许我需要制作一个自定义对话框类?
谢谢,
-RMW混沌