I coded a simple ttkbootstrap/tkinter application that contains 4 Frames that divides the "root" window in 4 and added a simple button and a Text widget.
Here's the code:
import ttkbootstrap as ttk
root = ttk.Window(themename="darkly")
root.geometry("800x600")
root.columnconfigure([0,1,2,3,4,5,6,7,8,9], weight= 1, uniform="a")
root.rowconfigure([0,1,2,3,4,5,6,7,8,9], weight= 1, uniform="a")
#Creating Frames
frame1 = ttk.Frame(root, style="dark")
frame1.grid(row=0, column=0, columnspan=5, rowspan=5,sticky="nswe")
frame1.columnconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame1.rowconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame2 = ttk.Frame(root, style="light")
frame2.grid(row=0, column=5, columnspan=5,rowspan=5, sticky="nswe")
frame2.columnconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame2.rowconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame3 = ttk.Frame(root, style="light")
frame3.grid(row=5, column=0, columnspan=5, rowspan=5, sticky="nswe")
frame3.columnconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame3.rowconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame4 = ttk.Frame(root, style="dark")
frame4.grid(row=5, column=5, columnspan=5, rowspan=5, sticky="nswe")
frame4.columnconfigure([0,1,2,3,4,5], weight=1, uniform="a")
frame4.rowconfigure([0,1,2,3,4,5], weight=1, uniform="a")
#Widgets
start_button = ttk.Button(frame1, text="Start", bootstyle="default", command=start_app)
start_button.grid(row=1, column=0, columnspan=2, sticky="nswe")
texto = ttk.Text(root, wrap="word",width=1,height=1, font=("Helveltica", 12))
texto.grid(row=2, column=0, columnspan=3,rowspan=1 ,sticky="nswe")
texto.insert(index=ttk.END, chars="hello world")
scroll_y = ttk.Scrollbar(root, orient=ttk.VERTICAL, command=texto.yview, style="light")
scroll_y.grid(row=2, column=3,rowspan=1,sticky="wsn")
texto.config(yscrollcommand=scroll_y)
texto["yscrollcommand"] = scroll_y.set
root.mainloop()
Looks good.
But when I set the master of the texto instance to frame1, the whole layout gets messed up.
This is the code after changes
texto = ttk.Text(frame1, wrap="word",width=1,height=1, font=("Helveltica", 12))
texto.grid(row=2, column=0, columnspan=3,rowspan=1 ,sticky="nswe")
texto.insert(index=ttk.END, chars="hello world")
scroll_y = ttk.Scrollbar(frame1, orient=ttk.VERTICAL, command=texto.yview, style="light")
scroll_y.grid(row=2, column=3,rowspan=1,sticky="wsn")
texto.config(yscrollcommand=scroll_y)
texto["yscrollcommand"] = scroll_y.set
Does anyone know why this happens, and how to fix it? I need them to stop resizing. Even when I set the master to root it can produce some strange behaviour, and screw all the frame positioning.
Tried changing the master to frame1 and my layout got messy and uneven. I need them to stop resizing.


frame1has 5 rows, which you have constrained to all be the same height, but you've only put widgets in two of those rows. Whichever one is tallest (not sure if this is the Text or the Scrollbar) sets the uniform row height, and therefore the Frame is necessarily five times as tall. (I think you're misunderstanding grid rows and columns, anyway - each container has its own, entirely independent grid system. The fact that each Frame contains five rows does not mean that they have to occupy anything more than a single row in the root window.)