[IPython-dev] widget models caching the view
Sat Feb 22 21:19:06 CST 2014
On 2/22/14 8:58 PM, Brian Granger wrote:
> Hi, sorry, just catching up. I am confused. I don't see how this is
> even possible. In browsers/DOM it is not possible to have a single DOM
> element displayed in multiple places on the page. Isn't that what this
> change tries to do? If it does work, I am guessing that it is broken -
> surely the events won't fire properly when the view is on the page
> multiple times.
But widget views !== dom elements. For my usecase, for example, widget
views are Three.js objects. And you can certainly have the same
three.js object in multiple places in the scene graph. For example, I
want the same geometry object with several different kinds of material.
> Conceptually, I think we *do* want multiple views. Each view maps onto
> one place in the page where the widget is displayed. Each of those
> instances needs to be able to handle its own events, etc. For example,
> only one instance of the view can have focus at a time or accept
> keyboard input.
> Am I missing something?
I thought we were transitioning to having multiple widgets for display
in different places that were linked together. The "view" is really the
python instance+backbone model+backbone view. If you want a widget in
multiple places, create multiple widgets and link them together. The
model/python instance, then you really probably ought to expose those
views on the python side with full python view classes.
More information about the IPython-dev