title: position of line when resizing Tkinter window
body: <p>The following code:</p>
  
  <pre><code>from tkinter import *
  root=Tk()
  for x in range(10):
      for y in range(10):
          canvas=Canvas(root, width='15',height='15',highlightthickness=0,bg='red')                      
          canvas.create_line(canvas.winfo_x(),canvas.winfo_y(),canvas.winfo_x()+15,canvas.winfo_y()+15,width=2,fill='black')
          canvas.grid(row=y,column=x,sticky='NESW')
  for x in range(10):
      for y in range(10):
          root.columnconfigure(x,weight=1)
          root.rowconfigure(y,weight=1)
  root.mainloop()
  </code></pre>
  
  <p>produces <a href="https://i.stack.imgur.com/HVW7P.png" rel="nofollow noreferrer">this</a>, which is a 10 by 10 grid filled with canvases; there is a line extending from the top left to the bottom right corner of each canvas.</p>
  
  <p>When I resize the window, the canvas widgets resize correctly, but the lines retain their shape <a href="https://i.stack.imgur.com/L3itU.png" rel="nofollow noreferrer">like this</a>. The lines need to adjust according to the window/widget size.</p>
  
  <p>The core of the problem is that the lines are made using the coordinates of the top left corner of the widget, and are extended 15 pixels in each direction. Is there a way of getting the coordinates of the bottom right corner of the widget, so that the lines can change their shape dynamically, or some other way of keeping the lines shape, relative to the widget?</p>