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

Fix listeners hooked up using observe but unhooked using on_trait_change #766

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

rahulporuri
Copy link
Contributor

This PR fixes two listeners that are hooked up using observe but are then unhooked using on_trait_change.

the listeners are hooked up using observe but are then unhooked using
on_trait_change

	modified:   enable/scrolled.py
@jwiggins jwiggins requested a review from aaronayres35 March 30, 2021 11:37
Copy link
Contributor

@aaronayres35 aaronayres35 left a comment

Choose a reason for hiding this comment

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

These changes LGTM

Looking closer at what is hooked/unhooked it looks like we do hook things up to the _handle_mouse_thumb method but I don't see any removals 🤔 (w/ on_trait_change or with observe). In any case, that could be addressed in a separate PR

@rahulporuri
Copy link
Contributor Author

Im looking at the _handle_mouse_thumb method and im not sure who is responsible for unhooking it. It looks like it is getting hooked up alongside _handle_vertcal_scroll and _handle_vertical_scroll but im not sure if _release_sb is the right place/time to unhook the listeners for _handle_mouse_thumb. I'm merging this for now.

@rahulporuri rahulporuri merged commit dd351d6 into master Mar 30, 2021
@rahulporuri rahulporuri deleted the fix/missed-otc-observe branch March 30, 2021 12:46
@aaronayres35
Copy link
Contributor

Im looking at the _handle_mouse_thumb method and im not sure who is responsible for unhooking it. It looks like it is getting hooked up alongside _handle_vertcal_scroll and _handle_vertical_scroll but im not sure if _release_sb is the right place/time to unhook the listeners for _handle_mouse_thumb. I'm merging this for now.

SGTM, I was in the same boat. It seems like _release_sb makes the most sense as they are handlers hooked up to scroll bars, but I too wasn't certain. We can address this separately

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