-
Notifications
You must be signed in to change notification settings - Fork 95
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
Dynamic otc to observe 2 #1525
Dynamic otc to observe 2 #1525
Conversation
Ah I realize my hacky fix was dumb... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a couple of comments.
@@ -201,7 +201,7 @@ def init(self, ui, parent, style): | |||
self.control.accept, | |||
default=default, | |||
) | |||
ui.on_trait_change(self._on_error, "errors", dispatch="ui") | |||
ui.observe(self._on_error, "errors", dispatch="ui") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't seem to be unhooking this listener.
@@ -155,7 +155,7 @@ def init(self, ui, parent, style): | |||
self.control.accept, | |||
default=default, | |||
) | |||
ui.on_trait_change(self._on_error, "errors", dispatch="ui") | |||
ui.observe(self._on_error, "errors", dispatch="ui") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we have two listeners that don't get unhooked in this module. Instead of going over your PRs again and creating an issue pointing out unhooked listeners like we did in Pyface, let's create an issue in traitsui now - which we can continually update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened #1526
contributes to #1052
This PR updates a few files to use dynamic
observe
instead ofon_trait_change
. More similar PRs to follow