[wxpython-users] Adding pages to FlatNotebook

"Jürgen Waser" JuergenWaser at gmx.at
Thu May 22 07:19:38 PDT 2008


Nice,

Method PageContainer.DoSetSelection does the right job!


-------- Original-Nachricht --------
> Datum: Thu, 22 May 2008 14:51:52 +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 11:18 PM, "Jürgen Waser" wrote:
> > 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.
> 
> Try the following:
> 
> 1) Add to FlatNotebook source code the following method:
> 
>     def EnsureVisible(self, page):
>         """ Ensures that a tab is visible. """
> 
>         self._pages.DoSetSelection(page)
> 
> 2) Insert this function in your script and call it every time you add
> a new page and you want it visible:
> 
>     def MakeTabVisible(self, pageNum):
> 
>         # If you want to make visible the rightmost tab
>         self.EnsureVisible(pageNum)
> 
> 
> Where "self" now is really a FlatNotebook :-D . This should really go
> in SVN, but I am not sure if the default behavior when adding pages to
> a notebook should be to make their tabs visible if they are selected.
> If this is the case, I'll go and update wxPython SVN with these
> modifications.
> 
> 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

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx


More information about the wxpython-users mailing list