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

Add "handled" state to event #70

Merged
merged 1 commit into from
Jul 11, 2019
Merged

Add "handled" state to event #70

merged 1 commit into from
Jul 11, 2019

Conversation

raphlinus
Copy link
Contributor

Allow an event to be handled, blocking further propagation.

Allow an event to be handled, blocking further propagation.
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

This is suitable for my purposes, thanks!


/// Set the event as "handled", which stops its propagation to other
/// widgets.
pub fn set_handled(&mut self) {
Copy link
Member

Choose a reason for hiding this comment

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

There's an asymmetry here between set_handled and set_active. I prefer this to not take an argument, but maybe set_active doesn't need to either?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, set_active can definitely take false, for example on mouse-up in a button. I don't think it makes any sense to unset handled. Open to ideas of improving naming/docs tho.

@cmyr cmyr merged commit 3d4659a into muggle Jul 11, 2019
@cmyr cmyr deleted the handled branch July 11, 2019 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants