|
|
|
|
@ -282,6 +282,8 @@ class Widget(LoggingConfigurable):
|
|
|
|
|
def on_displayed(self, callback, remove=False):
|
|
|
|
|
"""Register a callback to be called when the widget has been displayed
|
|
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
|
----------
|
|
|
|
|
callback: method handler
|
|
|
|
|
Can have a signature of:
|
|
|
|
|
- callback()
|
|
|
|
|
@ -298,6 +300,8 @@ class Widget(LoggingConfigurable):
|
|
|
|
|
def handle_displayed(self, view_name):
|
|
|
|
|
"""Called when a view has been displayed for this widget instance
|
|
|
|
|
|
|
|
|
|
Parameters
|
|
|
|
|
----------
|
|
|
|
|
view_name: unicode
|
|
|
|
|
Name of the view that was displayed."""
|
|
|
|
|
for handler in self._display_callbacks:
|
|
|
|
|
@ -321,7 +325,6 @@ class Widget(LoggingConfigurable):
|
|
|
|
|
'accept 0-2 arguments, not %d.' % nargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Support methods
|
|
|
|
|
def _repr_widget_(self, view_name=None):
|
|
|
|
|
"""Function that is called when `IPython.display.display` is called on
|
|
|
|
|
|