title: How do you make widgets take up all space proportionally when the window is resized?
body: <p>When</p>
  <pre><code>window.resizable(True, True)
  </code></pre>
  <p>and you maximize the window, you get the following:</p>
  <p><a href="https://i.stack.imgur.com/Y4pkA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y4pkA.png" alt="resized_window" /></a></p>
  <p>As you can see, the widigets <strong>do not take up the remaining space</strong>.</p>
  <h2>Code:</h2>
  <pre><code>import tkinter as tk
  
  win = tk.Tk()
  
  f1 = tk.Frame(win, background = 'yellow', width = '10', height = '20')
  f2 = tk.Frame(win, background = 'purple', width = '10', height = '20')
  
  f1.grid(column = 0, row = 0, sticky = 'nsew')
  f2.grid(column = 1, row = 0, sticky = 'nsew')
  
  win.mainloop()
  </code></pre>
  <p>To solve this, I've <strong>added to the code</strong> the following:</p>
  <pre><code>win.grid_columnconfigure(0, weight = 1)
  win.grid_columnconfigure(1, weight = 1)
  
  win.grid_rowconfigure(0, weight = 1)
  win.grid_rowconfigure(1, weight = 1)
  
  win.mainloop()
  </code></pre>
  <p>Unfortunately, <strong>it did not work.</strong> The widgets did get bigger, but not enough to fill up all the remaining space, which is colored grey.</p>
  <p><a href="https://i.stack.imgur.com/NsXS7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NsXS7.png" alt="failed_solution" /></a></p>
  <h2>Question:</h2>
  <p>How would you make the widgets <strong>take up all the remaining space proportionally</strong>? I mean, If <em>widget_one</em> is three times the size of <em>widget_two</em>, when you resize the window, you use up all the space in the resized window. Thus, <strong><em>widget_one</em> is three times <em>widget_two</em> remains true and both widgets fill up the remaining space.</strong></p>
  <p>Something like this:</p>
  <p><a href="https://i.stack.imgur.com/VtsXh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VtsXh.png" alt="desired" /></a></p>
  <p>That is, <em>without unfilled</em> grey parts of the resized window.</p>