Mike Driscoll schrieb:
Try this:
self.sel_site.SetFont(wx.Font(11, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "Courier"))
Thanks.
I did that, but it did not change the font:
panel =wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, (-1, -1), style =wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
site_table = '*', 'L', 'A', 'E', 'D', 'T' ]
self.sel_site =wx.ComboBox(panel, wx.ID_CLOSE, size=wx.Size(105, 29), value=site_table[0], choices=site_table)
self.sel_site.SetFont(wx.Font(7, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "Courier"))
In another place in the same prog I change the font for a ListCtrl
and that works:
self.lctr_test = wx.ListCtrl(panel, wx.ID_ANY, wx.DefaultPosition, (390, -1),
style = wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.LC_VRULES | wx.LC_HRULES | wx.FULL_REPAINT_ON_RESIZE) # ListCtrl
self.lctr_test.SetFont(wx.Font(7, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "Courier"))
Observation: (which I do not understand)
If I set the Font for the panel wherein the ComboBox and ListCtrl are
the Fonts on all controls change except that of the choices in the wx.ComboBox
System:
Linux susi96 2.6.22.17-0.1-default #1 SMP 2008/02/10 20:01:04 UTC i686 i686 i386 GNU/Linux
Python 2.5.1
wxPython 2.8.7.1
Grüessli
···
--
Kurt Müller, mu@problemlos.ch