Kirix Support Forums

wxAuiNotebook - Reverse Split()

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxAuiNotebook - Reverse Split()

Postby neurino on Thu Jan 22, 2009 9:43 am

I'm trying to understand how I can implement some basic operations with wxAuiNotebook
like splitting n-tabs in 1/n total width horizontal or vertical tabs (for example automatically split the window with 3 vertical tabs 1/3 of the window width each).

I think I can do it using SetDockSizeConstraint and Split

But what about revrting the process i.e. taking back the tabs full-window one above the other???

Something like Join(page, onPage) ???

Thanks for your support!
neurino
Registered User
 
Posts: 2
Joined: Thu Jan 22, 2009 9:27 am

Re: wxAuiNotebook - Reverse Split()

Postby neurino on Thu Jan 22, 2009 11:14 am

Ok, I got how to restore tabs but now:
what about dividing equally window width/height while splitting multiple tabs (like 1/3widht with 3 vertical tabs???)

Code: Select all
    def restoreTabs(self):
        'restores original view after Tab Splits'
        #remember the tab now selected
        nowSelected = self.notebook.GetSelection()
        #select first tab as destination
        self.notebook.SetSelection(0)
        #iterate all other tabs
        for idx in xrange(1, self.notebook.GetPageCount()):
            #get win reference
            win = self.notebook.GetPage(idx)
            #get tab title
            title = self.notebook.GetPageText(idx)
            #remove from notebook
            self.notebook.RemovePage(idx)
            #re-add in the same position so it will tab
            self.notebook.InsertPage(idx, win, title)
        #restore orignial selected tab
        self.notebook.SetSelection(nowSelected)


Thanks for the support
neurino
Registered User
 
Posts: 2
Joined: Thu Jan 22, 2009 9:27 am

Re: wxAuiNotebook - Reverse Split()

Postby Ben on Fri Jan 23, 2009 10:31 am

I don't know that there is any programmatic way of doing that. I believe that right now it's all user-controlled. I'd be happy for API suggestions.

Ben
Ben Williams
Kirix Support Team
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Questions, Thoughts & Feedback