Reputation: 1
is this a widget you can use in tkinter and if so what is it called? i see it on many different pieces of software such as task manager (as seen in the picture), OpenRGB and others. thanks in advance
Upvotes: 0
Views: 35
Reputation: 51
this widget is called a Notebook. A notebook is a widget that contains multiple frames that are accessible by tab buttons. It is created like this:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
#This is the notebook widget
nb = ttk.Notebook(root)
nb.pack(pady=10, expand=True)
#Creating frames for the notebook
frame1 = tk.Frame(nb)
frame1.pack(fill='both', expand=True)
frame2 = tk.Frame(nb)
frame2.pack(fill='both', expand=True)
frame3 = tk.Frame(nb)
frame3.pack(fill='both', expand=True)
#Adding the frames to the notebook
nb.add(frame1, text='tab_name')
nb.add(frame2, text='tab_name')
nb.add(frame3, text='tab_name')
Upvotes: 1