WebKit2.ScriptDialog¶
Fields¶
None
Methods¶
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class WebKit2.ScriptDialog¶
Carries details to be shown in user-facing dialogs.
- close()¶
Close self.
When handling a
WebKit2.ScriptDialogasynchronously (WebKit2.ScriptDialog.ref() was called inWebKit2.WebView::script-dialogcallback), 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.New in version 2.24.
- confirm_set_confirmed(confirmed)¶
- Parameters:
confirmed (
bool) – whether user confirmed the dialog
Set whether the user confirmed the dialog.
This method is used for
WebKit2.ScriptDialogType.CONFIRMandWebKit2.ScriptDialogType.BEFORE_UNLOAD_CONFIRMdialogs whenWebKit2.WebView::script-dialogsignal is emitted to set whether the user confirmed the dialog or not. The default implementation ofWebKit2.WebView::script-dialogsignal setsTruewhen the OK or Stay buttons are clicked andFalseotherwise. It’s an error to use this method with aWebKit2.ScriptDialogthat is not of typeWebKit2.ScriptDialogType.CONFIRMorWebKit2.ScriptDialogType.BEFORE_UNLOAD_CONFIRM
- get_dialog_type()¶
- Returns:
the
WebKit2.ScriptDialogTypeof self- Return type:
Get the dialog type of a
WebKit2.ScriptDialog.
- get_message()¶
- Returns:
the message of self.
- Return type:
Get the message of a
WebKit2.ScriptDialog.
- prompt_get_default_text()¶
- Returns:
the default text of self
- Return type:
Get the default text of a
WebKit2.ScriptDialogof typeWebKit2.ScriptDialogType.PROMPT.It’s an error to use this method with a
WebKit2.ScriptDialogthat is not of typeWebKit2.ScriptDialogType.PROMPT.
- prompt_set_text(text)¶
- Parameters:
text (
str) – the text to set
Set the text entered by the user in the dialog.
This method is used for
WebKit2.ScriptDialogType.PROMPTdialogs whenWebKit2.WebView::script-dialogsignal is emitted to set the text entered by the user. The default implementation ofWebKit2.WebView::script-dialogsignal sets the text of the entry form when OK button is clicked, otherwiseNoneis set. It’s an error to use this method with aWebKit2.ScriptDialogthat is not of typeWebKit2.ScriptDialogType.PROMPT.
- ref()¶
- Returns:
The passed in
WebKit2.ScriptDialog- Return type:
Atomically increments the reference count of self by one.
This function is MT-safe and may be called from any thread.
New in version 2.24.
- unref()¶
Atomically decrements the reference count of self by one.
If the reference count drops to 0, all memory allocated by the #WebKitScriptdialog is released. This function is MT-safe and may be called from any thread.
New in version 2.24.