changing PointSize in a wx notebook after it's created

I’m unable to change the PointSize in
the controls/pages in a wx notebook once the

notebook is created.

The notebook class below is in a frame. If I set the PointSize in the
frame before

creating the notebook, then everything in the notebook correctly
inherits that PointSize, but the

code below, and every other variation I can think of, won’t change the
point size

once the notebook exists.

Help !?!?!?

class MyNotebook(wx.Notebook):

def __init__(self, parent, id, size=None, pos=None, pointSize=None):

    wx.Notebook.__init__(self, parent, id, style= wx.BK_DEFAULT )

    

def NewPage(self, pageName)

    # add a page with a list control

    page = displayListControl.ListCtrlPanel(self, group)

    self.AddPage(page, pageName)

    

    

def MyPointSize(self, pointSize):

    for i in range( self.GetPageCount() ):

        win = self.GetPage(i)

        font = win.GetFont()

        font.SetPointSize( pointSize )

        win.SetFont(font)

        win.Refresh()
···

BobAtTP wrote:

I'm unable to change the PointSize in the controls/pages in a wx notebook once the
notebook is created.

The notebook class below is in a frame. If I set the PointSize in the frame before
creating the notebook, then everything in the notebook correctly inherits that PointSize, but the
code below, and every other variation I can think of, won't change the point size
once the notebook exists.

It sounds like you are wanting to change the fonts of the widgets contained in the notebook, not necessarily just the notebook itself. If that is the case then you'll have to recursively descend through all the children of the notebook, all of their children, etc. and call SetFont on all of the widgets. The font is only inherited from the parent at the time of creation of a child widget.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!