I want to expand label to fill window
For example we use in tk button
parent.columnconfigure(0, weight=1)
button.grid(sticky='ew')
Can we do something like this to expand both label name to capture all available screen
And my second question : How to change background color or all available settings for that label or button tab
Thanks in advance
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('600x400+0+0')
root.columnconfigure(0, weight=1)
root.rowconfigure(0, weight=1)
tabs = ttk.Notebook()
tabs.grid(row=0, column=0, sticky='nsew')
tab1 = tk.Frame(tabs, bg='red')
tab2 = tk.Frame(tabs, bg='green')
tabs.add(tab1, text='First Tab')
tabs.add(tab2, text='Second Tab')
root.mainloop()
from How to expand ttk notebook label or tab button to fill window
No comments:
Post a Comment