code: def fix(self):
          
          # Do up to 2 passes in case we have a variable height Layout.
          fill_layout = None
          fill_height = y = 0
          for _ in range(2):
              # Pick starting point/height - varies for borders.
              if self._has_border:
                  x = y = start_y = 1
                  height = self._canvas.height - 2
                  width = self._canvas.width - 2
              else:
                  x = y = start_y = 0
                  height = self._canvas.height
                  width = self._canvas.width
  
              # Process each Layout in the Frame - getting required height for
              # each.
              for layout in self._layouts:
                  if layout.fill_frame:
                      if fill_layout is None:
                          # First pass - remember it for now.
                          fill_layout = layout
                      elif fill_layout == layout:
                          # Second pass - pass in max height
                          y = layout.fix(x, y, width, fill_height)
                      else:
                          # A second filler - this is a bug in the application.
                          raise Highlander("Too many Layouts filling Frame")
                  else:
                      y = layout.fix(x, y, width, height)
  
              # If we hit a variable height Layout - figure out the available
              # space and reset everything to the new values.
              if fill_layout is None:
                  break
              else:
                  fill_height = max(1, start_y + height - y)
  
          # Remember the resulting height of the underlying Layouts.
          self._max_height = y
  
          # Reset text
          while self._focus < len(self._layouts):
              try:
                  self._layouts[self._focus].focus(force_first=True)
                  break
              except IndexError:
                  self._focus += 1
          self._clear()
docs: Fix the layouts and calculate the locations of all the widgets.
  
          This function should be called once all Layouts have been added to the Frame and all
          widgets added to the Layouts.