I'm trying to get the order of tabs in
an auiNotebook (instantiated with style =wx.aui.AUI_NB_TAB_MOVE) after
the pages of the note book have been shuffled around. However the
obvious way (at least to me) of doing some thing like the following
pageCount = self.tabber.GetPageCount()
tabOrder =[]
for i in range(pageCount):
title = self.tabber.GetPageText(i)
tabOrder.append(title)
gives me the same order regardless how the tabs have been dragged
around.
Can anybody point me in the correct direction?
I'm trying to get the order of tabs in
an auiNotebook (instantiated with style =wx.aui.AUI_NB_TAB_MOVE) after
the pages of the note book have been shuffled around. However the
obvious way (at least to me) of doing some thing like the following
pageCount = self.tabber.GetPageCount()
tabOrder =
for i in range(pageCount):
title = self.tabber.GetPageText(i)
tabOrder.append(title)
gives me the same order regardless how the tabs have been dragged
around.
My guess is that's so you can always refer to the N'th page you added as Page N no matter how the user has moved them around.
Can anybody point me in the correct direction?
Use the notebook's GetChildren to find the child of type AuiTabCtrl. IIRC that is what maps the logical page numbers to the actual. You should be able to do something like this:
info = tabCtrl.GetPage(N)
print info.caption, info.window
Use the notebook's GetChildren to find the child of type AuiTabCtrl.
IIRC that is what maps the logical page numbers to the actual. You
should be able to do something like this:
info = tabCtrl\.GetPage\(N\)
print info\.caption, info\.window
I had the same issue and this solution works perfectly. Thanks Robyn.
Hi Robin,
Thank you for your response - although I've yet to implement your
suggestion it looks as though Steve has confirmed its value.
Dominic
···
On Aug 2, 6:31 pm, Steve Zatz <slz...@gmail.com> wrote:
> Use the notebook's GetChildren to find the child of type AuiTabCtrl.
> IIRC that is what maps the logical page numbers to the actual. You
> should be able to do something like this:
> info = tabCtrl.GetPage(N)
> print info.caption, info.window
I had the same issue and this solution works perfectly. Thanks Robyn.