title: Tkinter Grid Dynamic Layout
body: <p>I am wanting to create a grid layout, with a grid that fills the first row until it runs out of space in the window, and will dynamically move items to the row below (like text line-wrapping).  As the window width is adjusted, the grid adjusts to fit.  The boxes resizing is not desired. I intend to maintain each small box's size, but change where the layout puts each box.  </p>
  
  <p>I imagine this functionality is possible by measuring the width of the frame, and if the (number of boxes)*(width of each box) exceeds the width, move to the next row.  I was just wondering if there was a better way built in that I'm not understanding.  </p>
  
  <p>If the above is the only option, what is the best way to update that? Do I have to set an event on window resize or something?  It seems like I shouldn't have to rework a layout manager, which is what that feels like.  I just want to check if similar functionality is already built in. Grid seems like a powerful layout manager, but I have not been able to find that option.</p>
  
  <p>The below pics describes the behavior I want using the same set of 6 boxes on a single frame using grid layout.</p>
  
  <p>Window is wide enough to hold all 6 boxes, so they all fit on row 1. They then adjust as window size changes.
  <a href="https://i.stack.imgur.com/JnBIG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/JnBIG.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/RVRr5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/RVRr5.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/q2uuL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/q2uuL.png" alt="enter image description here"></a></p>