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')

20th Jun 2017, 11:14 AM
lars
2 ответов
+ 2
you need a function. def draw(): .... .... connect draw to Button # button = Button(....., command=draw)
7th Nov 2017, 11:21 AM
Da Riebi
Da Riebi - avatar
7th Nov 2017, 11:27 AM
Da Riebi
Da Riebi - avatar