-
Notifications
You must be signed in to change notification settings - Fork 2
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 explicit Pingee connect and disconnect methods #255
Conversation
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 question/comment. And I don't think there's any relevant docs so we don't need to worry about updating them.
it would be nice to put together dev docs on the topic though, while this is all still fresh in your head
@@ -76,12 +76,18 @@ class Pingee(wx.EvtHandler): | |||
|
|||
def __init__(self, on_ping): | |||
wx.EvtHandler.__init__(self) | |||
self._on_ping = on_ping | |||
self._on_ping = lambda event: on_ping() |
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.
This feels like an orthogonal change - changing
self._on_pingand replacing
self._on_ping_eventwith
self._on_pingin the
self.Bind` call. I'm not sure why this is needed.
Is this just refactoring/making the code cleaner?
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.
Sorry, yes, it's mostly orthogonal, except that with this change I can be sure that I'm binding and unbinding the exact same handler. (That would probably have been true with the method lookups too, assuming that wx is working with Python equality rather than identity, but with this change I don't have to make that assumption.) Call it superstition again, but this PR is mostly superstition anyway (which is what makes the changes hard to test).
Agreed. I'll open an issue, and point to the existing PR description that contained a dump of the routing stuff. |
Opened #261 |
This PR adds
connect
anddisconnect
methods to thePingee
(small-'i', implicit) interface. In particular, this gives thewx
Pingee an opportunity to undo the binding that it made.Closes #254.