
Pmw.NoteBook() - a set of tabbed pages
A notebook contains a set of tabbed pages. At any one time only one of these pages (the selected page) is visible, with the other pages being hidden "beneath" it. Another page in the notebook may be displayed by clicking on the tab attached to the page. The tabs are displayed along the top edge.
Optionally, the notebook may be displayed without tabs. In this case, another selection widget, such as Pmw.OptionMenu, may be used to select the pages.
This megawidget is derived from Pmw.MegaArchetype (not Pmw.MegaWidget like most other megawidgets), with the hull class being Tkinter.Canvas.
selectpage()
method. The default is 'n'.
Page and tab components are created dynamically by the add()
and insert() methods. By default, the pages are of type
Tkinter.Frame and are created with a component group of Page
and the tabs are of type Tkinter.Button and are created with a
component group of Tab.
insert() method
for full details.
index() method.
If the currently selected page is deleted, then the next page, in index order, is selected. If the end page is deleted, then the previous page is selected.
If forInsert is true, Pmw.END returns the number of pages rather than the index of the last page.
index() method. If
tabpos is not None, also create a tab as a component named
pageName-tab. Keyword arguments prefixed with page_ or
tab_ are passed to the respective constructors when creating the
page or tab. If the tab_text keyword argument is not given, the
text option of the tab defaults to pageName. If a page is
inserted into an empty notebook, the page is selected. To add a
page to the end of the notebook, use add(). The method returns
the pageName component widget.
index()
method.
Pmw.Color.changecolor().
update_idletasks() so that the width and height of the
pages can be determined. This may cause the notebook to flash
onto the screen at the default size before resizing to the natural
size.
index()
method. If tabpos is None, return None.
class Demo:
def __init__(self, parent):
# Create and pack the NoteBook.
notebook = Pmw.NoteBook(parent)
notebook.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
# Add the "Appearance" page to the notebook.
page = notebook.add('Appearance')
# Create the "Toolbar" contents of the page.
group = Pmw.Group(page, tag_text = 'Toolbar')
group.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
b1 = Tkinter.Checkbutton(group.interior(), text = 'Show toolbar')
b1.grid(row = 0, column = 0)
b2 = Tkinter.Checkbutton(group.interior(), text = 'Toolbar tips')
b2.grid(row = 0, column = 1)
# Create the "Startup" contents of the page.
group = Pmw.Group(page, tag_text = 'Startup')
group.pack(fill = 'both', expand = 1, padx = 10, pady = 10)
home = Pmw.EntryField(group.interior(), labelpos = 'w',
label_text = 'Home page location:')
home.pack(fill = 'x', padx = 20, pady = 10)
# Add two more empty pages.
page = notebook.add('Helpers')
page = notebook.add('Images')
notebook.setnaturalpagesize()
Home.
Pmw 0.8.3
Maintainer
gregm@iname.com.
22 Oct 1999
Manual page last reviewed: 18 October 1999