MCPcopy Index your code
hub / github.com/python/cpython / Notebook

Class Notebook

Lib/tkinter/ttk.py:782–912  ·  view source on GitHub ↗

Ttk Notebook widget manages a collection of windows and displays a single one at a time. Each child window is associated with a tab, which the user may select to change the currently-displayed window.

Source from the content-addressed store, hash-verified

780
781
782class Notebook(Widget):
783 """Ttk Notebook widget manages a collection of windows and displays
784 a single one at a time. Each child window is associated with a tab,
785 which the user may select to change the currently-displayed window."""
786
787 def __init__(self, master=None, **kw):
788 """Construct a Ttk Notebook with parent master.
789
790 STANDARD OPTIONS
791
792 class, cursor, style, takefocus
793
794 WIDGET-SPECIFIC OPTIONS
795
796 height, padding, width
797
798 TAB OPTIONS
799
800 state, sticky, padding, text, image, compound, underline
801
802 TAB IDENTIFIERS (tab_id)
803
804 The tab_id argument found in several methods may take any of
805 the following forms:
806
807 * An integer between zero and the number of tabs
808 * The name of a child window
809 * A positional specification of the form "@x,y", which
810 defines the tab
811 * The string "current", which identifies the
812 currently-selected tab
813 * The string "end", which returns the number of tabs (only
814 valid for method index)
815 """
816 Widget.__init__(self, master, "ttk::notebook", kw)
817
818
819 def add(self, child, **kw):
820 """Adds a new tab to the notebook.
821
822 If window is currently managed by the notebook but hidden, it is
823 restored to its previous position."""
824 self.tk.call(self._w, "add", child, *(_format_optdict(kw)))
825
826
827 def forget(self, tab_id):
828 """Removes the tab specified by tab_id, unmaps and unmanages the
829 associated window."""
830 self.tk.call(self._w, "forget", tab_id)
831
832
833 def hide(self, tab_id):
834 """Hides the tab specified by tab_id.
835
836 The tab will not be displayed, but the associated window remains
837 managed by the notebook and its configuration remembered. Hidden
838 tabs may be restored with the add command."""
839 self.tk.call(self._w, "hide", tab_id)

Callers 1

create_widgetsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…