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
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, itsay...@gmail.com 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
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.
···
On 16/09/2018 22:37, itsayellow@gmail.com 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?
--
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.
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, itsay...@gmail.com 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