clone method for ABCWidgetFactory? #6044
When we "Create new view for X", the command
calls the document manager clone method:
However, there may be view state that should be shared among the views. For a cloned notebook view, I think it makes more sense for the rendermime to be shared. For example, we add a notebook-specific renderer to the rendermime for ipywidgets. We could share the rendermime if we knew it was a clone, rather than a brand new view.
Can we push the notion of 'clone' all the way down to the WidgetFactory creating views? We could even have a default implementation that just creates a new view, but then let specific widget factories override the clone method.
We do have an alternative for ipywidgets - we could attach the rendermime renderer to the context, which is shared between the views, and that way have access to the original document's renderer. However, this seems somewhat hacky, when perhaps you want the views to actually share some state.
The text was updated successfully, but these errors were encountered: