class tab_panel.TabPanel(Widget)A TabPanel is a widget that manages a collection of pages and displays one of them at a time. Switching between pages is accomplished by means of a row of tabs at the top of the TabPanel, one for each page. Clicking on a tab brings its corresponding page to the front.
Tab background colour determinationNormally, the background of each tab is filled with the bg_color of its associated page, so that it appears to be an extension of it. If the page has a tab_bg_color attribute, that colour is used instead of its bg_color. If the page specifies neither of these, the default_tab_bg_color of the TabPanel is used.
- TabPanel(pages = None)
- The pages, if provided, should be a sequence of (title, widget) pairs, which will be added as by the add_page() method.
- Font in which to display the page titles in the tabs.
- Height of the tabs.
- Width of the border, if any, to draw around each tab.
- Width of space to leave between adjacent tabs.
- Width of space to leave before the first tab and after the last tab.
- Colour in which to display the page titles.
- Colour with which to fill the background of any tab whose page does not specify a tab colour.
- Colour with which to fill any background areas of the tab region not covered by a tab.
- Factor by which to dim the background colour of tabs other than the currently selected tab. Range 0.0 to 1.0.
- Read only. List of widgets that have been added as pages. Don't modify this list directly; use the add_page() and remove_page() methods.
- Read only. The currently displayed page widget. Use the show_page() method to change this.
- add_page(title, widget)
- Adds the given widget as a new page, with the specified title to be displayed in its tab. Note: The widget should not also be added using add(); the TabPanel will do that itself when appropriate.
- Removes the specified page, if present.
- Makes the specified page the currently displayed page.
- Returns a tuple (width, height) of the size of the content area, i.e. the area that a page will take up when it is displayed.
- Returns a Rect representing the content area in the local coordinate system of the TabPanel.
- Returns the height of a page (equal to the height of the content_rect()).