EventBlocker vs Unbind / Bind

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

EventBlocker vs Unbind / Bind

itsayellow
I have a question about temporarily disabling event bindings.  I've seen that this can be done using EventBlocker, and also by Unbind and Bind to re-enable.

My question is, are there technical differences between the two approaches?  Or is EventBlocker just a convenience / different-syntax way of accomplishing the exact same thing that Unbind / Bind does?

thanks in advance,
Matt

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: EventBlocker vs Unbind / Bind

itsayellow
Thinking about this more, I can imagine one main difference is EventBlocker prevents *all* Bindings of an event from occurring (by preventing the event itself,) while Unbind is removing a specific binding while allowing others to still occur.  EventBlocker seems more complete and Unbind more specific.

Is that the main difference, or are there other subtle technical concerns I'm not grasping?

On Sunday, September 16, 2018 at 2:26:56 PM UTC-7, [hidden email] wrote:
I have a question about temporarily disabling event bindings.  I've seen that this can be done using EventBlocker, and also by Unbind and Bind to re-enable.

My question is, are there technical differences between the two approaches?  Or is EventBlocker just a convenience / different-syntax way of accomplishing the exact same thing that Unbind / Bind does?

thanks in advance,
Matt

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: EventBlocker vs Unbind / Bind

GadgetSteve


On 16/09/2018 22:37, [hidden email] wrote:
> Thinking about this more, I can imagine one main difference is
> EventBlocker prevents *all* Bindings of an event from occurring (by
> preventing the event itself,) while Unbind is removing a specific
> binding while allowing others to still occur.  EventBlocker seems more
> complete and Unbind more specific.
>
> Is that the main difference, or are there other subtle technical
> concerns I'm not grasping?
>
The other major differences IIRC are that EvenBlocker will put things
back as they were but Unbind/Bind can be used to reassign the event to
another handler. Also, IIRC even new bindings will remain blocked until
EvenBlocker is released.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: EventBlocker vs Unbind / Bind

itsayellow
Thanks for the notes, Steve, they helpd.

I realized that I still wanted any other upstream handlers to work on the event, just not my own handler, so I used Unbind / Bind for my own handler.

On Sunday, September 16, 2018 at 9:28:20 PM UTC-7, Gadget Steve wrote:


On 16/09/2018 22:37, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="FOdOkgjREQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">itsay...@... wrote:
> Thinking about this more, I can imagine one main difference is
> EventBlocker prevents *all* Bindings of an event from occurring (by
> preventing the event itself,) while Unbind is removing a specific
> binding while allowing others to still occur.  EventBlocker seems more
> complete and Unbind more specific.
>
> Is that the main difference, or are there other subtle technical
> concerns I'm not grasping?
>
The other major differences IIRC are that EvenBlocker will put things
back as they were but Unbind/Bind can be used to reassign the event to
another handler. Also, IIRC even new bindings will remain blocked until
EvenBlocker is released.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

---
This email has been checked for viruses by AVG.
<a href="https://www.avg.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avg.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNErX2VZQElyN1XAQ1JS-bYYtVyfHg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.avg.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNErX2VZQElyN1XAQ1JS-bYYtVyfHg&#39;;return true;">https://www.avg.com

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.