state Option of Notebook ( tabs )

ttk Notebook state option

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

We can manage the state option of the Notebook through buttons. Full Code is here.

state option

normal : this is the default value with all functionality.
disabled : Not selectable but visible
hidden : Not visible
import tkinter  as tk 
from tkinter import *
from tkinter import ttk
my_w = tk.Tk()
my_tabs = ttk.Notebook(my_w) # declaring 

tab0 = ttk.Frame(my_tabs)
tab1 = ttk.Frame(my_tabs)
tab2 = ttk.Frame(my_tabs)

my_tabs.add(tab0, text ='Tab-0') # adding tab
my_tabs.add(tab1, text ='Tab-1') # adding tab 
my_tabs.add(tab2, text ='Tab-2') # adding tab 
my_tabs.pack(expand = 1, fill ="both")

font1=('times',22,'normal') # font size 
l1=tk.Label(tab0,text='I am tab-0',bg='yellow',font=font1),rely=0.2) # using place layout

l2=tk.Label(tab1,text='I am tab-1',bg='yellow',font=font1),rely=0.2)

l3=tk.Label(tab2,text='I am tab-2',bg='yellow',font=font1),rely=0.2)

#place three buttons in parent window to manage the state option

my_w.mainloop()  # Keep the window open


hide() forget() and select() Methods Tab Option sticky underline image
On Tab change event to display Tab Number
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net


    perfect, thanks

    Post your comments , suggestion , error , requirements etc here

    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer