Notebook Documentation

The TkinterWeb Notebook widget should be used in place of ttk.Notebook, which is incompatable with Tkhtml on 64-bit Windows and crashes when selecting tabs. See https://docs.python.org/3/library/tkinter.ttk.html#notebook for the full API.

class tkinterweb.Notebook(master, takefocus=True, **kwargs)

Drop-in replacement for the ttk.Notebook widget.

add(child, **kwargs)

Adds a new tab to the notebook.

insert(where, child, **kwargs)

Adds a new tab at the specified position.

enable_traversal()

Enable keyboard traversal for a toplevel window containing this notebook.

select(tabId=None)

Select the given tabId.

tab(tabId, option=None, **kwargs)

Query or modify the options of the given tabId.

forget(tabId)

Removes the tab specified by tabId and unmaps the associated window.

index(child)

Returns the numeric index of the tab specified by child, or the total number of tabs if child is the string “end”.

tabs()

Returns a list of widgets managed by the notebook.

This widget also emits the following Tkinter virtual events that can be bound to:

  • <<NotebookTabChanged>>: Generated whenever the selected tab changes.