Augment - remove event handler

Hi @stucork,

Is there any way I can remove event handler after I set it, for example:
augment.set_event_handler(self.link, 'hover', self.link_hover)
I would like to inactivate it with button click and then reactivate it with another button click.
I tried:

augment.remove_event_handler(self, ‘hover’, self.hover)
and I got this error:

AttributeError: module 'newAnvilAugment.augment' has no attribute 'remove_event_handler'

Thank you!

I figured it out, so I added a remove_event_handler method to the Augment dependency:

def remove_event_handler(component, event,func):
    component.remove_event_handler(event,func)

and it worked; perhaps you could add it to the Augment library.

Regards,

3 Likes