python - How to Adjust Position of tkinter Canvas -


in program, want create tkinter canvas anchored @ top, left corner of screen, canvas defaulting different location on screen. here image of happening:

link image

here current code:

 #!/usr/bin/python  import tkinter  tkinter import *  pil import image, imagetk  root = tk() root.title("infrared camera interface") root.resizable(width=false, height=false)    class myapp:   def __init__(self, parent):      self.c = tkinter.canvas(root, bg="white", height=560, width=450)       #set dimensions of window     parent.minsize(width=600, height=600)     parent.maxsize(width=600, height=600)       #prepare image object being loaded stream camera     self.imgname = 'dish.png'     self.img = image.open(self.imgname)     self.img = self.img.resize((560, 450), image.antialias)           #display image onto stream     self.displayimg = imagetk.photoimage(self.img)      self.c.create_image(0,0,image = self.displayimg, anchor = nw)      self.c.pack()  myapp = myapp(root) root.mainloop() 

how can anchor canvas top, left corner of screen?


Comments