I have created a program that creates a citation based on entrybox inputs. I am trying to add a button that clears all the entryboxes when clicked; however, I find that the error 'NoneType' object has no attribute delete
occurs since none of my entry boxes are packed. When I do replace .place()
with .pack()
, I find that it works. Is there any way to make this function work with un-padded entry boxes (as I need these boxes in specific locations)?
This is the sample of my code:
from tkinter import *
#create window
win = Tk()
win.geometry("800x500")
#clear function
def clearBoxes():
author1Input.delete(0,END)
#entry box
author1 = StringVar()
author1Input = Entry(win,textvariable=author1).place(x=30,y=120)
#button to clear
Button(win,text="Clear",command=clearBoxes).place(x=30,y=200)
win.mainloop()