Tkinter 'ScrolledText' widget changes size when I change font size. This problem also persists for 'Text' widget.
I resolved parent frame resizing with font size of Text widget by using '.grid_propagate(False)' as suggested in this post.
I have tried '.grid_propagate(False)' on Text widget also to no avail. Text widget remains same size only when using 'sticky=nsew' but that stretches Text widget to fill the parent frame. Is there any way to handle this problem?
import tkinter as tk
from tkinter.scrolledtext import ScrolledText
window = tk.Tk();
PW1 = tk.PanedWindow(master=window,orient='vertical',bg="#E0E0E0",bd=9)
PW1.pack(side='left',expand='True',fill='both')
PW1.grid_propagate(False)
PW1.grid_rowconfigure(0, weight=1)
PW1.grid_columnconfigure(0, weight=1)
textField1 = ScrolledText(master=PW1,font=('Times New Roman',12))
textField1.grid(row=0, column=0, padx=5, pady=5,sticky='nsew')
window.mainloop()