Jul-24-2018, 08:23 PM
Hi,
I have a grid problem. I could not add the image named "emptycart.gif" under the "SHOPPING CART" label.
I have a grid problem. I could not add the image named "emptycart.gif" under the "SHOPPING CART" label.
from tkinter import * root = Tk() root.geometry("1600x800+200+0") root.title("PROJECT") clicks1 = 0 my_cart = ["emptycart.gif"] global x x = 1 def new_winB(): # new window definition newwin = Toplevel(root) newwin.geometry("1600x800+200+0") newwin.title("Shopping Cart") newwin.rowconfigure((0, 12), weight=50) newwin.columnconfigure((0, 12), weight=50) label_3 = Label(newwin, text="SHOPPING CART", bg="gray94", height=3, width=180) label_3.grid(row=3, columnspan=8) photo1 = PhotoImage(file=my_cart[0]) lbl1 = Label(newwin, image=photo1) lbl1.grid(row=4, columnspan=6) button1 =Button(root, text ="open new window", command =new_winB) button1.pack() root.mainloop()