code: def on_displayed(self, callback, remove=False):
          
          self._display_callbacks.register_callback(callback, remove=remove)
docs: (Un)Register a widget displayed callback.
  
          Parameters
          ----------
          callback: method handler
              Must have a signature of::
  
                  callback(widget, **kwargs)
  
              kwargs from display are passed through without modification.
          remove: bool
              True if the callback should be unregistered.