Base Widget class. Allows user to create widgets in the back-end that render in the IPython notebook front-end.
A structure for registering and running callbacks
(Un)Register a callback
callback: method handle
Closes the underlying comm. When the comm is closed, all of the widget views are automatically removed from the front-end.
Gets the widget state, or a piece of it.
key : unicode or iterable (optional)
Static method, called when a widget is constructed.
Hold syncing any state until the context manager is released
Gets the model id of this widget.
If a Comm doesn’t exist yet, a Comm will be created automagically.
(Un)Register a widget displayed callback.
callback: method handler
(Un)Register a custom msg receive callback.
Registers a callback to be called when a widget is constructed.
The callback must have the following signature: callback(widget)
Open a comm to the frontend if one isn’t already open.
Sends a custom msg to the widget model in the front-end.
content : dict
Sends the widget state, or a piece of it, to the front-end.
key : unicode, or iterable (optional)
Called when a state is received from the front-end.
Returns a decorator registering a widget class in the widget registry. If no key is provided, the class name is used as a key. A key is provided for each core IPython widget so that the frontend can use this key regardless of the language of the kernel