[wxpython-users] Adding pages to FlatNotebook

"Jürgen Waser" JuergenWaser at gmx.at
Wed May 21 15:18:23 PDT 2008


Thanks for the quick help!

Methods "IsTabVisible" and "RotateRight" are not part of the FlatNotebook but of the associated PageContainer. So I changed the code to (accessing private variable, not so pretty):

def MakeTabVisible(self, pageNum):
 
    if self._pages.IsTabVisible(pageNum):
         return

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

Unfortunately the code has no affect on the behaviour.

Thanks,
Jurgen


-------- Original-Nachricht --------
> Datum: Wed, 21 May 2008 22:07:41 +0100
> Von: "Andrea Gavana" <andrea.gavana at gmail.com>
> An: wxpython-users at lists.wxwidgets.org
> Betreff: Re: [wxpython-users] Adding pages to FlatNotebook

> 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/
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the wxpython-users mailing list