add_event_handler¶
- PresentFeature.add_event_handler(handler)¶
Add an event handler. All added event handlers are called when this feature changes. The
handler
can optionally accept aFeatureEvent
as the first and only argument. TheFeatureEvent
only has two attributes,type
which denotes the type of event as astr
in the form of “<feature_name>”, such as “color”. Andpick_info
which contains information about the event and Graphic that triggered it.- Parameters:
handler (callable) – a function to call when this feature changes