Is There A Way To Set Tabs Of A Notebook Below One Another?
So far when using the ttk.Notebook widget, but I am unable to set tabs below one another, they keep piling up eastward. Is there a way to set them to stack somehow?
Solution 1:
Yes, please check this code:
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
style = ttk.Style(root)
style.configure('lefttab.TNotebook', tabposition='wn')
notebook = ttk.Notebook(root, style='lefttab.TNotebook')
f1 = tk.Frame(notebook, bg='red', width=200, height=200)
f2 = tk.Frame(notebook, bg='blue', width=200, height=200)
notebook.add(f1, text='Frame 1')
notebook.add(f2, text='Frame 2')
notebook.grid(row=0, column=0, sticky="nw")
root.mainloop()
Solution 2:
No, there is not a way to do that with the ttk notebook widget.
On a side note: multiple rows of tabs is widely regarded as being very user-UNfriendly from a usability perspective. If you need to create a UI that has that many tabs, you might want to consider a different approach if you're concerned about how easy your program is to use.
Solution 3:
For reference - Yes
See the code in the following top right tabs
And use 'wn'
to force the tabs to stack in the top left and downwards
Post a Comment for "Is There A Way To Set Tabs Of A Notebook Below One Another?"