mirror of
https://github.com/tauri-apps/web-view.git
synced 2026-02-04 02:11:18 +01:00
Add info, warning and error to dialog example
This commit is contained in:
@@ -26,9 +26,12 @@ fn main() -> WVResult {
|
||||
.dialog()
|
||||
.warning("Warning", "You didn't choose a file."),
|
||||
}?,
|
||||
"exit" => {
|
||||
webview.exit();
|
||||
}
|
||||
"info" => webview.dialog().info("Info", "This is a info dialog")?,
|
||||
"warning" => webview
|
||||
.dialog()
|
||||
.warning("Warning", "This is a warning dialog")?,
|
||||
"error" => webview.dialog().error("Error", "This is a error dialog")?,
|
||||
"exit" => webview.exit(),
|
||||
_ => unimplemented!(),
|
||||
};
|
||||
Ok(())
|
||||
@@ -42,8 +45,11 @@ const HTML: &str = r#"
|
||||
<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<button onclick="external.invoke('open')">Open</button>
|
||||
<button onclick="external.invoke('open')">Open</button>
|
||||
<button onclick="external.invoke('save')">Save</button>
|
||||
<button onclick="external.invoke('info')">Info</button>
|
||||
<button onclick="external.invoke('warning')">Warning</button>
|
||||
<button onclick="external.invoke('error')">Error</button>
|
||||
<button onclick="external.invoke('exit')">Exit</button>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user