Tkinter Notebook to create tabs and managing options to add image underline state with click events

preview_player
Показать описание
6:15 Notebook methods Padding
7:00 Tab option STATE , disabled normal hidden
12:26 Tab option STICKY
16:28 Tab options image , compound
25:41 Tab option underline

Notebook widget is used to add child windows and display them through tabs. Notebook is part of ttk library and we have to import this library before using Notebook.

Notebook is having options height, width and padding. Height and width are desired height and width of the pans but will extend up to available dimensions. Padding is the gap of the pane from the parent window.
The child window tab as several options which can be managed.
State, sticky, text, image , compound, underline are the options for the tabs.
State: This can take values like disabled, normal and hidden. By default the value is normal and it can be changed to disabled and hidden. In case of disabled the tab is visible but can’t be accessed. In Hidden state the tab will not be visible to user.
Sticky, : Option is used in grid layout and align the window in different directions.
Text: The text displayed at the top of the child window for selection by user
Image: Image can be displayed along with the text ( or only image ) in each tab top.
Compound : how the image and text is to be displayed
Underline : required for mnemonic activation ( using keys for selecting the tabs )
We can place buttons in parent window ( not in tabs ) and use the click event of these buttons to manage the values of various options.


Part II on how to trigger events and use various methods to manage tabs

#tkinternotebook #tkinterTabs #TabOptions #NotebookOptions #TkinterTabState #plus2net #tkinter #python #Options
Рекомендации по теме