Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Sandbox applications to exit. #1175

Merged
merged 2 commits into from
Jan 3, 2022
Merged

Conversation

EkardNT
Copy link
Contributor

@EkardNT EkardNT commented Dec 29, 2021

I noticed that when using the Sandbox its not possible to graceful tell iced to quit. Although I understand that Sandbox is a simplified alternative to Application, it seemed to me that Sandbox users may still want the ability to exit.

To make it possible for Sandbox programs to quit, this PR adds a fn should_exit(&self) -> bool method to the Sandbox trait. The Sandbox trait defines the default implementation of should_exit to return false, just like Application does, so Sandbox users who do not care about the ability to exit should notice no difference.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you 🙇

@hecrj hecrj merged commit 7ab584c into iced-rs:master Jan 3, 2022
@hecrj hecrj added the feature New feature or request label Jan 3, 2022
@hecrj hecrj added this to the 0.4.0 milestone Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants