add_event_handler

GraphicFeatureIndexable.add_event_handler(handler)

Add an event handler. All added event handlers are called when this feature changes. The handler can optionally accept a FeatureEvent as the first and only argument. The FeatureEvent only has two attributes, type which denotes the type of event as a str in the form of “<feature_name>”, such as “color”. And pick_info which contains information about the event and Graphic that triggered it.

Parameters:

handler (callable) – a function to call when this feature changes