I have function in my program calls a class which opens a new window
class TopLevel3:
def __init__(self):
self.root2 = Toplevel()
self.canvas3 = Canvas(self.root2, width=400, height=200)
self.canvas3.pack()
self.root2.title("ImageDB")
r = 0
for c in range(6):
Label(relief=RIDGE, width=55).grid(row=r, column=0)
Entry(relief=SUNKEN, width=20).grid(row=r, column=1)
Button(text='View Image').grid(row=r, column=2)
Button(text='Update Tag').grid(row=r, column=3)
r = r+1
self.root2.mainloop()
This is called by a function in another class:
def img_db(self):
TopLevel3()
But instead of the labels & buttons appearing in the new child window they appear in the parent window itself.
(Image attached)
Where am I going wrong?