You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ability to disable callbacks temporarily #20802
It may be useful to update some attributes on an object that has callbacks temporarily and we don't want those callback signals being processed during that time.
I guess we could add a disabling_callbacks() context manager on CallbackRegistry?
In Qt, this is Widget->blockSignals, and in GTK, it is g_signal_handlers_block_*. Wx has a wxEventBlocker that you add on a widget to temporarily stop events. Not sure if Tk has anything similar.
IOW, it seems like 'block' is the common term for this for events, though I don't know if these callbacks qualify as 'events'.
Activity
timhoffm commentedon Aug 7, 2021
Naming suggestion:
callbacks_disabled()or even onlydisabled():QuLogic commentedon Aug 9, 2021
In Qt, this is
Widget->blockSignals, and in GTK, it isg_signal_handlers_block_*. Wx has awxEventBlockerthat you add on a widget to temporarily stop events. Not sure if Tk has anything similar.IOW, it seems like 'block' is the common term for this for events, though I don't know if these callbacks qualify as 'events'.