add_event_handler#

LineStack.add_event_handler(*args)#

Register an event handler.

Parameters:
  • callback (callable, the first argument) – Event handler, must accept a single event argument

  • *types (list of strings) – A list of event types, ex: “click”, “data”, “colors”, “pointer_down”

  • types (For the available renderer event)

  • see

  • https (//jupyter-rfb.readthedocs.io/en/stable/events.html)

  • events (All feature support)

  • of (i.e. graphic.features will give a set)

  • evented (all features that are)

  • decorator. (Can also be used as a)

Example

def my_handler(event):
    print(event)

graphic.add_event_handler(my_handler, "pointer_up", "pointer_down")

Decorator usage example:

@graphic.add_event_handler("click")
def my_handler(event):
    print(event)