[IPython-dev] More widget feasibility ideas

Nicholas Bollweg nick.bollweg at gmail.com
Sat Oct 25 19:51:22 EDT 2014


> 1.   pop up a short description of the function
>
The bootstrap popover would be a good way to do this:
http://getbootstrap.com/javascript/#popovers

Unlike some of the bootstrap components, you can't just add it with DOM
attributes, though, and actually need to do some JS. Here's a relatively
simple way to get a popover:
https://gist.github.com/bollwyvl/7c1d9606bc31272c825a

It has a lot of limitations: a better one would do a full container in the
popup body, expose all the options, etc.


> 2.  state information
>
Again, bootstrap mostly has you covered:
http://getbootstrap.com/components/#alerts

widgets.HTML(
    value="X",
    _dom_classes=["alert alert-danger"]
)

When you want it to be something else, you would just change the value and
the _dom_classes.


> 3.  tabbed-view
>

There is already a tabs widget, which subclasses Box:

widgets.Tab(
    _titles={0: "A", 1: "B"},
    children=[widgets.Box(), widgets.Box()]
)

It should be pretty easy to adapt this to your layout, and it can be
switched programattically with selected_index.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141025/544b13b0/attachment.html>


More information about the IPython-dev mailing list