textwxpythonsizewxnotebook

Changing tab text size in wxpython notebook


Is it possible to change the font size of the tab titles in a wx.Notebook? I know how to change the tab spacing/padding with SetPadding, but I want to change the actual size of the text as well.


Solution

  • Use the Notebook's SetFont method:

    notebook.SetFont(wx.Font(8, wx.FONTFAMILY_DEFAULT,
                             wx.FONTWEIGHT_NORMAL, 
                             wx.FONTSTYLE_NORMAL))
    

    This worked for me with wxPython 2.8, Python 2.7 on Ubuntu