Tkinter: Getting an image above buttons in grid layout
You are not using self
as the parent of label1
. Besides, the grid manager starts at row 0:
def question1_UI(self): # ... label1 = Label(self, image=gif1) label1.image = gif1 label1.grid(row = 0, column = 0, columnspan = 2, sticky=NW) questionAButton = Button(self, text='Submit',font=('MS', 8,'bold')) questionAButton.grid(row = 1, column = 0, sticky = S) questionBButton = Button(self, text='Submit',font=('MS', 8,'bold')) questionBButton.grid(row = 1, column = 1, sticky = S) questionCButton = Button(self, text='Submit',font=('MS', 8,'bold')) questionCButton.grid(row = 2, column = 0, sticky = S) questionDButton = Button(self, text='Submit',font=('MS', 8,'bold')) questionDButton.grid(row = 2, column = 1, sticky = S)