Ghido:
Hi all i want to set wx.toolbar font size and i use this code:
self.tb1 = wx.ToolBar(self, -1, style=wx.TB_HORIZONTAL|
wx.TB_TEXT)
self.tb1.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL,0))
self.SetToolBar(self.tb1)
but i obtain nothing. Is possibile? where i wrong?
I use wxpython 2.6.3 on ubuntu edgy
You need to call self.tb1.Realize(). BTW, you probably want to add some
tools to the toolbar too. See attachment.
Cheers, Frank
import wx
class Frame(wx.Frame):
def __init__(self, *args, **kwargs):
super(Frame, self).__init__(*args, **kwargs)
self.tb = wx.ToolBar(self, style=wx.TB_HORIZONTAL|wx.TB_TEXT)
self.tb.SetFont(wx.Font(7, wx.DEFAULT, wx.NORMAL, wx.NORMAL))
self.tb.AddLabelTool(10, "New",
wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR))
self.tb.Realize()
self.SetToolBar(self.tb)
app = wx.App(False)
frame = Frame(None)
frame.Show()
app.MainLoop()
--
http://mail.python.org/mailman/listinfo/python-list