Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- tk=Tk()
- tk.geometry("1000x400")
- def Button_click():
- global image
- if var.get()==1:
- image=PhotoImage(file='flowers.png')
- if var.get()==2:
- image=PhotoImage(file='cake.png')
- if var.get()==3:
- image=PhotoImage(file='landscape.png')
- select=lb.curselection()
- lbl3=Label(text=lb.get(select)+","+ent.get()+"!")
- lbl3.place(x=350, y=300)
- canvas.create_image(500,200, image=image)
- def Button2_click():
- lbl2=Label(text="Бувай, " +ent.get())
- lbl2.place(x=350, y=300)
- canvas=Canvas(tk, width=600, height=400)
- canvas.pack()
- image=PhotoImage(file="flowers.png")
- btn1=Button(text="Привітання", command=Button_click)
- btn1.place(x=500,y=200,width=100,height=50)
- btn2=Button(text="Прощавання", command=Button2_click)
- btn2.place(x=350,y=200,width=100,height=50)
- ent=Entry()
- ent.place(x=450,y=100,width=100,height=30)
- lbl1=Label(text="Ваше ім'я")
- lbl1.place(x=200,y=100)
- lb=Listbox(height=3)
- lb.insert(END,"З 8 березня")
- lb.insert(END,"З Новим Роком")
- lb.insert(END,"З Днем народження")
- lb.place(x=375,y=25)
- var=IntVar()
- rb1=Radiobutton(text="цветочки", variable=var, value=1)
- rb2=Radiobutton(text="торт", variable=var, value=2)
- rb3=Radiobutton(text="пейзаж", variable=var, value=3)
- rb1.place(x=600,y=250)
- rb2.place(x=600,y=300)
- rb3.place(x=600,y=350)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement