In this video I’ll show you how to use notebook tabs in TTKBootstrap, Tkinter, and Python.

Notebooks are a great way to organize your GUI apps by giving you tabbed frames that you can click thru.

I’ll show you how TTKBootstrap handles notebook tabs in this video, and how to change their color.

Python Code: nb.py
(Github Code)

from tkinter import *
import ttkbootstrap as tb


root = tb.Window(themename="superhero")

#root = Tk()
root.title("TTK Bootstrap! Notebook Tabs!")
root.iconbitmap('images/codemy.ico')
root.geometry('500x400')

my_notebook = tb.Notebook(root, bootstyle="dark")
my_notebook.pack(pady=20)

tab1 = tb.Frame(my_notebook)
tab2 = tb.Frame(my_notebook)

my_label = Label(tab1, text="My Awesome Label!", font=("Helvetica", 18))
my_label.pack(pady=20)

my_text = Text(tab1, width=70, height=10)
my_text.pack(pady=10, padx=10)

my_button = tb.Button(tab1, text="Click Me!", bootstyle="danger outline")
my_button.pack(pady=20)

my_label2 = Label(tab2, text="This Is Tab Two!", font=("Helvetica", 18))
my_label2.pack(pady=20)

# Add our frames to the notebook
my_notebook.add(tab1, text="Tab One")
my_notebook.add(tab2, text="Tab Two")




root.mainloop()


John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of the first dot com boom. After that he developed the award-winning Submission-Spider search engine submission software that's been used by over 3 million individuals, businesses, and governments in over 42 countries. He's written several Amazon #1 best selling books on coding, and runs a popular Youtube coding channel.

View all posts

Add comment

Your email address will not be published. Required fields are marked *

John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of...