title: How to create a self resizing grid of buttons in tkinter?
body: <p>I am trying to create a grid of buttons(in order to achieve the clickable cell effect) with Tkinter. </p>
  
  <p>My main problem is that I cannot make the <code>grid</code> and the buttons autoresize and fit the parent window. </p>
  
  <p>For example, when I have a high number of buttons on the grid, instead of shrinking the buttons so that the grid fits inside the window, I get a stretched frame that goes off screen.</p>
  
  <p>The effect that I am looking for is the grid filling all available space, then resizing its cells to fit within that space. I have read at the documentation, but I still cannot figure out how to make it work. </p>
  
  <p>This is the basic code which is my starting point:</p>
  
  <pre><code>def __init__(self):
      root = Tk()
      frame = Frame(root)
      frame.grid()
  
      #some widgets get added in the first 6 rows of the frame's grid          
  
      #initialize grid
      grid = Frame(frame)  
      grid.grid(sticky=N+S+E+W, column=0, row=7, columnspan=2)
  
      #example values
      for x in range(60):
          for y in range(30):
              btn = Button(grid)
              btn.grid(column=x, row=y)
  
      root.mainloop()
  </code></pre>