def METHOD_NAME(self, shellwidget):
    """Create a new widget in the stack and associate it to shellwidget."""
    shellwidget_id = id(shellwidget)
    if shellwidget_id not in self._shellwidgets:
        widget = self.create_new_widget(shellwidget)
        self._stack.addWidget(widget)
        self._shellwidgets[shellwidget_id] = widget
        # Add all actions to new widget for shortcuts to work.
        for __, action in self.get_actions().items():
            if action:
                widget_actions = widget.actions()
                if action not in widget_actions:
                    widget.addAction(action)
        self.set_shellwidget(shellwidget)