[wxpython-users] Adding pages to FlatNotebook

Andrea Gavana andrea.gavana at gmail.com
Wed May 21 14:07:41 PDT 2008


Hi Jurgen,

On Wed, May 21, 2008 at 9:47 PM, "Jürgen Waser" wrote:
> In my application it is often the case that the user adds many pages to a wx.lib.FlatNotebook. The recently appended page is selected
> automatically (meaning AddPage(..., select=True)). However, the related tab on top is not shown if there are already too many pages. One has to click on the navigator arrows to navigate to the selected notebook. Please have a look at the attached screenshots to see what I
> mean. It would be nice if the selected
> tab is shown on top automatically when the user adds a page. Otherwise it is a bit confusing. Thank you for your time,

You may try something like this (untested at the moment, I'll check tomorrow):

def MakeTabVisible(self, pageNum):

    if self.IsTabVisible(pageNum):
        return

    # If you want to make visible the rightmost tab
    self.RotateRight()

And then, eveny time you add a new page, you can call this function
with self.GetPageCount()-1 as argument (self is the flatnotebook).

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/


More information about the wxpython-users mailing list