0
How to create a rectangle with a clock on a button?(tkinter)
I want to create a rectangle if I press the button. (Only works on computer) from tkinter import * root=Tk () fz1 = Canvas (root, width=600,height=300,bg='yellow') fz1.pack() Knopf = Button (text=' press me ') Knopf.pack (side=BOTTOM, fill=X) Button.create_rectangle (3,2,30,20, fill 'red')
2 ответов
+ 2
you need a function.
def draw():
....
....
connect draw to Button
# button = Button(....., command=draw)