I'm trying to generate the output of each Button click to an Entry, each time I press generate button the output shows up in the console, but I want it to show in the GUI so I tried to add the command command=gen
to the Entry and it gives me an error, it seems like Entry's don't accept the argument command, but I'm not too sure if it's just a syntax error, is there another way of displaying the output of the Button click on the Gui? The reason why I wanted it to be an Entry is because it provides a perfect rectangular shape with white inside the box which is perfect for generating things.
from Tkinter import *
def gen():
print ("testetstesttesttest")
window = Tk()
window.geometry("500x300")
window.title("TestGUI")
botton = Button(window, text="Generate ids",command=gen).place(x=210,y=160)
textbox = Entry(window, command=gen).place(x=210,y=100)
window.mainloop()
The error I receive:
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: unknown option "-command"