    def clone(self, screen, scene):
        """
        Create a clone of this Dialog into a new Screen.

        :param screen: The new Screen object to clone into.
        :param scene: The new Scene object to clone into.
        """
        # Only clone the object if the function is safe to do so.
        if self._on_close is None or isfunction(self._on_close):
            scene.add_effect(PopUpDialog(screen, self._text, self._buttons, self._on_close))
Create a clone of this Dialog into a new Screen.

:param screen: The new Screen object to clone into.
:param scene: The new Scene object to clone into.
asciimatics/widgets/popupdialog.py