def add_pane(self, pane, vsplit=False):
assert isinstance(pane, Pane)<EOL>assert isinstance(vsplit, bool)<EOL>split_cls = VSplit if vsplit else HSplit<EOL>if self.active_pane is None:<EOL><INDENT>self.root.append(pane)<EOL><DEDENT>else:<EOL><INDENT>parent = self._get_parent(self.active_pane)<EOL>same_direction = isinstance(parent, split_cls)<EOL>index = parent.index(self.active_pane)<EOL>if same_direction:<EOL><INDENT>parent.insert(index + <NUM_LIT:1>, pane)<EOL><DEDENT>else:<EOL><INDENT>new_split = split_cls([self.active_pane, pane])<EOL>parent[index] = new_split<EOL>parent.weights[new_split] = parent.weights[self.active_pane]<EOL><DEDENT><DEDENT>self.active_pane = pane<EOL>self.zoom = False<EOL>
Add another pane to this Window.