I've been following an online tkinter tutorial, as it suits a lot of my needs. A modification I'm trying to introduce is for displaying an image. I'm struggling and wonder if any one could advise. Here's a section of the code, with my lines for the image file currently #'d out to make them obvious. Interestingly, although the image doesn't show, there are no errors when I run the program. I'm hoping the issue will be obvious and its just my novice status.
Thanks for your time.
Code: Select all
class StartPage (ttk.Frame): def __init__(self,parent,controller): ttk.Frame.__init__(self,parent) label = ttk.Label(self,text="Start Page", font=LARGE_FONT,) label.grid(row=0,column=0) image = ImageTk.PhotoImage(file='B:\BCP\C4_MAN_ENG_TEAM\Rob\Python\Visual\918.jpg') picture=ttk.Label(self,image=image) picture.grid(row=0, column=1) button1 = ttk.Button(self, text="Visit Page 1", command=lambda:controller.show_frame(PageOne)) button1.grid(row=1,column=0) button2 = ttk.Button(self, text="Visit Page Two", command=lambda:controller.show_frame(PageTwo)) button2.grid(row=2, column=0)