#________________ WELCOME ALL OF YOU ON COMPUTER SOFT SKILLS CHANNEL __________
#......................... PYTHON PROGRAM TO INSERT IMAGE AND CREATE BUTTON AND LABEL ....................
from tkinter import *
def top_level():
top =Toplevel(window)
#THIS IS MAIN WINDOW TITLE
top.title("COMPUTER SOFT SKILLS, OTHER PAGE")
top.geometry("400x400")
#MAIN WINDOW ICON
top.iconbitmap("D:\\python\\image\\ICON.ico")
label = Label (top , image = img_1, bd=5, relief=SUNKEN)
label.pack(padx=15, pady=15, side=RIGHT)
button = Button(top , image = img_2, bd=5, relief=RAISED, command=top_level)
button.pack(padx=15, pady=15, side=LEFT)
top.mainloop()
window =Tk()
window.title("COMPUTER SOFT SKILLS_ADD IMAGE")
window.geometry("650x650")
window.iconbitmap("D:\\python\\image\\ICON.ico")
img_1= PhotoImage(name="img_1" , file="D:\python\image\gpc.png")
img_2= PhotoImage(name="img_2" , file="D:\\python\\image\\blogo.png")
label = Label (window , image = img_1, bd=5, relief=SUNKEN)
label.pack(padx=15, pady=15, side=RIGHT)
button = Button(window , image = img_2, bd=5, relief=RAISED, command=top_level)
button.pack(padx=15, pady=15, side=LEFT)
window.mainloop()
0 Comments