:right-sidebar: True ScriptDialog =================================================================== .. currentmodule:: gi.repository.WebKit .. class:: ScriptDialog(*args, **kwargs) :no-contents-entry: Carries details to be shown in user-facing dialogs. Methods ------- .. rst-class:: interim-class .. class:: ScriptDialog :no-index: .. method:: close() -> None Close ``dialog``\. When handling a :obj:`~gi.repository.WebKit.ScriptDialog` asynchronously (:func:`~gi.repository.WebKit.ScriptDialog.ref` was called in :obj:`~gi.repository.WebKit.WebView`\::script-dialog callback), this function needs to be called to notify that we are done with the script dialog. The dialog will be closed on destruction if this function hasn't been called before. .. versionadded:: 2.24 .. method:: confirm_set_confirmed(confirmed: bool) -> None Set whether the user confirmed the dialog. This method is used for :const:`~gi.repository.WebKit.ScriptDialogType.CONFIRM` and :const:`~gi.repository.WebKit.ScriptDialogType.BEFORE_UNLOAD_CONFIRM` dialogs when :obj:`~gi.repository.WebKit.WebView`\::script-dialog signal is emitted to set whether the user confirmed the dialog or not. The default implementation of :obj:`~gi.repository.WebKit.WebView`\::script-dialog signal sets :const:`True` when the OK or Stay buttons are clicked and :const:`False` otherwise. It's an error to use this method with a :obj:`~gi.repository.WebKit.ScriptDialog` that is not of type :const:`~gi.repository.WebKit.ScriptDialogType.CONFIRM` or :const:`~gi.repository.WebKit.ScriptDialogType.BEFORE_UNLOAD_CONFIRM` :param confirmed: whether user confirmed the dialog .. method:: get_dialog_type() -> ~gi.repository.WebKit.ScriptDialogType Get the dialog type of a :obj:`~gi.repository.WebKit.ScriptDialog`\. .. method:: get_message() -> str Get the message of a :obj:`~gi.repository.WebKit.ScriptDialog`\. .. method:: prompt_get_default_text() -> str Get the default text of a :obj:`~gi.repository.WebKit.ScriptDialog` of type :const:`~gi.repository.WebKit.ScriptDialogType.PROMPT`. It's an error to use this method with a :obj:`~gi.repository.WebKit.ScriptDialog` that is not of type :const:`~gi.repository.WebKit.ScriptDialogType.PROMPT`. .. method:: prompt_set_text(text: str) -> None Set the text entered by the user in the dialog. This method is used for :const:`~gi.repository.WebKit.ScriptDialogType.PROMPT` dialogs when :obj:`~gi.repository.WebKit.WebView`\::script-dialog signal is emitted to set the text entered by the user. The default implementation of :obj:`~gi.repository.WebKit.WebView`\::script-dialog signal sets the text of the entry form when OK button is clicked, otherwise :const:`None` is set. It's an error to use this method with a :obj:`~gi.repository.WebKit.ScriptDialog` that is not of type :const:`~gi.repository.WebKit.ScriptDialogType.PROMPT`. :param text: the text to set