'Constructor arguments:
page_names -- A list of strings, each will be the dictionary key to a
page\'s widget, and the name displayed on the page\'s tab. Should be
specified in the desired page order. The first page will be the default
and first active page. If page_names is None or empty, the
TabbedPageSet will be initialized empty.
n_rows, max_tabs_per_row -- Parameters for the TabSet which will
manage the tabs. See TabSet\'s docs for details.
page_class -- Pages can be shown/hidden using three mechanisms:
* PageLift - All pages will be rendered one on top of the other. When
a page is selected, it will be brought to the top, thus hiding all
other pages. Using this method, the TabbedPageSet will not be resized
when pages are switched. (It may still be resized when pages are
added/removed.)
* PageRemove - When a page is selected, the currently showing page is
hidden, and the new page shown in its place. Using this method, the
TabbedPageSet may resize when pages are changed.
* PagePackForget - This mechanism uses the pack placement manager.
When a page is shown it is packed, and when it is hidden it is
unpacked (i.e. pack_forget). This mechanism may also cause the
TabbedPageSet to resize when the page is changed.'

def __init__(self, parent, page_names=None, page_class=PageLift, n_rows=1, max_tabs_per_row=5, expand_tabs=False, **kw):

    Frame.__init__(self, parent, **kw)
    self.page_class = page_class
    self.pages = {}
    self._pages_order = []
    self._current_page = None
    self._default_page = None
    self.columnconfigure(0, weight=1)
    self.rowconfigure(1, weight=1)
    self.pages_frame = Frame(self)
    self.pages_frame.grid(row=1, column=0, sticky=NSEW)
    if self.page_class.uses_grid:
        self.pages_frame.columnconfigure(0, weight=1)
        self.pages_frame.rowconfigure(0, weight=1)
    self._tab_set = TabSet(self, self.change_page, n_rows=n_rows, max_tabs_per_row=max_tabs_per_row, expand_tabs=expand_tabs)
    if page_names:
        for name in page_names:
            self.add_page(name)
    self._tab_set.grid(row=0, column=0, sticky=NSEW)
    self.change_page(self._default_page)
