code: def add_pane(self, pane, vsplit=False):
          
          assert isinstance(pane, Pane)
          assert isinstance(vsplit, bool)
  
          split_cls = VSplit if vsplit else HSplit
  
          if self.active_pane is None:
              self.root.append(pane)
          else:
              parent = self._get_parent(self.active_pane)
              same_direction = isinstance(parent, split_cls)
  
              index = parent.index(self.active_pane)
  
              if same_direction:
                  parent.insert(index + 1, pane)
              else:
                  new_split = split_cls([self.active_pane, pane])
                  parent[index] = new_split
  
                  # Give the newly created split the same weight as the original
                  # pane that was at this position.
                  parent.weights[new_split] = parent.weights[self.active_pane]
  
          self.active_pane = pane
          self.zoom = False
docs: Add another pane to this Window.