I want a frame of width=320 on the left side of the window with a canvas in which I have to display data from the file. There will be a number of widgets (data) on that canvas, so I want to also use a scrollbar in that. When I used pack(), nothing is being displayed on the window- not even the frame with bg="sky blue" is visible. Please tell me what's wrong. I've tried all combinations of fill=BOTH,expand=True, etc. etc. Still, I am unable to make what I want to.
root = Tk()
root.state('zoomed') #zooms the screen to maxm whenever executed
root.geometry('550x650')
root.minsize(550,650)
#Frame inside root
ContactDetails_frame = Frame(root,width=320,bg='sky blue',bd=2, relief=RIDGE)
ContactDetails_frame.pack(side=LEFT,fill=BOTH)
#Canvas inside the frame
canvas = Canvas(ContactDetails_frame,width=320,bg='sky blue',scrollregion=(30,0,1000,1000))
canvas.pack(fill=BOTH,expand=True)
#Vertical scrollbar for canvas
scrollbar = Scrollbar(canvas,orient=VERTICAL)
scrollbar.pack(side=RIGHT,fill=Y,expand=True)
#Attach scrollbar to canvas
canvas.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=canvas.yview)
#Here are the widgets
FirstName = Label(canvas, text="First name: ", font=(12),bg='sky blue',fg='black')
canvas.create_window(10,175, window=FirstName)
MiddleName = Label(canvas, text="Middle name: ",font=(12),bg='sky blue',fg='black')
canvas.create_window(10,195, window=MiddleName)
LastName = Label(canvas, text="Last name: ",font=(12),bg='sky blue',fg='black')
canvas.create_window(10,215, window=LastName)
NickName = Label(canvas, text="Nick name: ",font=(12),bg='sky blue',fg='black')
canvas.create_window(10,235, window=NickName)
Note = Label(canvas, text="Note: ",font=(12),bg='sky blue',fg='black')
canvas.create_window(10,855, window=Note)
root.mainloop()
ContactDetails_frame. - acw1668