Hi all,
I wish to hide tabs but not destroy them. I want the windows to be
created as pages but detached from the wxNotebook first .. A problem
there is that the controls are still visible on the wxNotebook even
when the page is not added. I tried an ugly hack by hiding the whole
panel but creating it as child from the wxNotebook, and when needed,
re-add it with InsertPage and making the page visible. This is not
really a desired implementation for a simple hide functionality ..
does anyone know a tab manager that does implement hide possibilities?
Basically I want to hide / show some tabs when they are not appropiate.
My current solution:
for t in hidetabs:
# hide every tab that we should not show
if t in self._present_pages:
idx = self._present_pages.index(t)
tab = self._page_lookup[t]
self.__mNB.RemovePage(idx)
self._present_pages.remove(t)
tab.Hide()
idx = where the tab should be
tab = the tab that should be hidden
tab.Hide() should not show all children when the tab is "removed"
For showing hidden tabs:
# show every tab not yet hidden
for t in showtabs:
if t not in self._present_pages:
# first check if we have enough pages so we can use
the index lookup
# to insert the page. If not we simply add it
idx = self._page_order.index(t)
pg = self._page_lookup[t]
if idx < self.__mNB.GetPageCount():
self.__mNB.InsertPage(idx, pg, self._page_text[t])
else:
self.__mNB.AddPage(pg, self._page_text[t])
self._present_pages.append(t)
pg.Show()
This way works for hiding tabs, but adding tabs is not going well in
wxAuiNotebook. For example, the last added tab is shown as contents,
but the selection is still on the first index. I cannot seem to force
the index back to the first ..
Creating and destroying pages is not an option for me unfortunately.
Does anyone have a workaround / solution / component that can hide
whole pages?
Regards,
- Jorgen