Answers for "new tab in tkinter"

0

new tab in tkinter

from tkinter import *
from tkinter.ttk import Notebook		# import Notebook

# create new window
root = Tk()

# create tabcontrol 
tabcontrol = Notebook(root)

# create a number of tabs you want to add
tab1 = Frame(tabcontrol)
tab2 = Frame(tabcontrol)

# add the tabs to the tabcontrol
tabcontrol.add(tab1, text='This is Tab 1')
tabcontrol.add(tab2, text='This is Tab 2')

# grid the tabcontrol
tabcontrol.grid(column=0, row=0, padx=100, pady=100)

root.mainloop()
Posted by: Guest on January-17-2021

Python Answers by Framework

Browse Popular Code Answers by Language