from tkinter import *
root=Tk() root.geometry('400x400')
def btn1(): label2 = Label(text = "Hello "+ ent.get()+'!') label2.place(x=150, y=150) canvas.create_image(100, 0, anchor = NW, image = fl_img)
button1 = Button(text = "Hello", command = btn1) button1.place(x=75,y=75, width=100, height=50)
button2 = Button(text = "Exit", command = root.destroy) button2.place(x=225,y=75, width=100, height=50)
ent = Entry(bd=1) ent.place(x=225,y=25, width=100, height=30)
label1 = Label(text = "Enter your name:") label1.place(x=75, y=25, width=100, height=30)
canvas = Canvas(width = 500, height = 500) canvas.place(x=0, y=200) fl_img = PhotoImage(file = "flowers.png")
root.mainloop()
3
показа
15
открытий
0
Комментарии