Traceback (most recent call last):
File “/Users/kalybarly/.py”, line 22, in
arial.grid(row=0, column=0, sticky=tk.W+tk.E)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/init.py”, line 2522, in grid_configure
self.tk.call(
_tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack
import tkinter as tk
root = tk.Tk()
fnt = 'Arial'
root.title('Text Editor')
root.geometry('800x500')
ttl = tk.Label(root, text='Text Editor', font=('Arial', 25), height=3)
ttl.pack(padx=10, pady=20)
text = tk.Text(root, font=(fnt, 16))
text.pack(padx=0, pady = 10)
button_frame = tk.Frame(root)
button_frame.columnconfigure(0, weight=1)
button_frame.columnconfigure(1, weight=1)
button_frame.columnconfigure(2, weight=1)
arial = tk.Button(root, text='Arial', font=('Arial',10), height=1)
arial.grid(row=0, column=0, sticky=tk.W+tk.E)
button_frame.pack(fill='x')
root.mainloop()