Reputation: 125
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?
Upvotes: 6
Views: 4444
Reputation: 3885
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()
Upvotes: 7
Reputation: 91
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
Upvotes: 0