summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Drake Tetreault <ekardnt@ekardnt.com>2021-12-29 09:31:43 -0800
committerLibravatar Drake Tetreault <ekardnt@ekardnt.com>2021-12-29 09:34:37 -0800
commit8a70d10401eb1277718a19f47ff1e2a5c4c7564b (patch)
tree3f9735bbddef9e293e78fc2452b9896752975c9a /src
parent5466d6a11d0a4bee01e954b7c727b3fd67cea02a (diff)
downloadiced-8a70d10401eb1277718a19f47ff1e2a5c4c7564b.tar.gz
iced-8a70d10401eb1277718a19f47ff1e2a5c4c7564b.tar.bz2
iced-8a70d10401eb1277718a19f47ff1e2a5c4c7564b.zip
Allow Sandbox applications to exit.
Diffstat (limited to 'src')
-rw-r--r--src/sandbox.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sandbox.rs b/src/sandbox.rs
index 1b23196f..aabfb9c7 100644
--- a/src/sandbox.rs
+++ b/src/sandbox.rs
@@ -131,6 +131,13 @@ pub trait Sandbox {
1.0
}
+ /// Returns whether the [`Sandbox`] should be terminated.
+ ///
+ /// By default, it returns `false`.
+ fn should_exit(&self) -> bool {
+ false
+ }
+
/// Runs the [`Sandbox`].
///
/// On native platforms, this method will take control of the current thread
@@ -182,4 +189,8 @@ where
fn scale_factor(&self) -> f64 {
T::scale_factor(self)
}
+
+ fn should_exit(&self) -> bool {
+ T::should_exit(self)
+ }
}