title: How to catch width and height after resizing the window of the program (tkinter)
body: <p>(tkinter) I want to catch window width and height immediately after resizing. How could I do that, is any methods existing?</p>
  
  <p><strong>Edited question:</strong></p>
  
  <p><strong>deets,</strong> It is not a duplicate. Because <a href="https://stackoverflow.com/questions/22835289/how-to-get-tkinter-canvas-to-dynamically-resize-to-window-width">in the link</a> there is canvas, and this method</p>
  
  <pre><code>self.scale("all",0,0,wscale,hscale)
  </code></pre>
  
  <p>is not working for Frame.  I still doesn't know how to resize frame so it would had the same width and height as the window after I resize it. (Like in photoshop, I resize the window and background is changing sizes).</p>
  
  <p><strong>Bryan,</strong> I tried to resize with  as you said, but it doesn't work. I tagged where I tried to do it with '!!!' comment. My code:</p>
  
  <pre><code>    from tkinter import *
  import ctypes
  
  
  class Main(Frame):
      def __init__(self, main):
          Frame.__init__(self, main)
          # Vars that will be defined by user:
          self.canvas_width = 600
          self.canvas_height = 600
  
          self.frame_width = 750
          self.frame_height = 600
  
          # Flexible widgets when window size alters:
          main.columnconfigure(0, weight=1)
          main.rowconfigure(0, weight=1)
  
  
          # Canvas and frame
          self.canvas_frame = Frame(main, width=self.frame_width, height=self.frame_height, relief='groove')
          self.canvas_frame.grid(row=1, column=1)
          self.canvas_frame.grid_propagate(False)
          self.canvas = Canvas(self.canvas_frame, width = self.canvas_width, height = self.canvas_height,
                          bg='bisque')
          self.canvas.grid(row=0, column=0)
  
          # Right click menu
          self.rmenu = Menu(self.canvas_frame, tearoff=0, takefocus=0)
          self.rmenu.add_command(label='Add', command=self.hello)
          self.canvas.bind("&lt;ButtonPress-3&gt;", self.popup)
  
          # Bind
          self.canvas.bind("&lt;ButtonPress-1&gt;", self.scroll_start)
          self.canvas.bind("&lt;B1-Motion&gt;", self.scroll_move)
  
          self.canvas_frame.bind("&lt;Configure&gt;", self.on_resize) # !!!!
  
  
  
      # resizing window:
      def on_resize(self, event): # !!!!
          # determine the ratio of old width/height to new width/height
          self.canvas_frame.width = event.width
          self.canvas_frame.height = event.height
          # resize the canvas
          self.canvas_frame.config(width=self.canvas_frame.width, height=self.canvas_frame.height)
          print(self.canvas_frame.width)  # return the same height and width
          print(self.canvas_frame.height) # after resizing
  
  if __name__ == '__main__':
      main = Tk()
      Main(main)
      main.mainloop()
  </code></pre>