[IPython-dev] Proper use of accordion widget

Jonathan Frederic jon.freder at gmail.com
Thu Mar 20 12:56:25 EDT 2014


Thanks for reporting this guys.  I opened an issue:
https://github.com/ipython/ipython/issues/5397

Cheers,
Jon

On Thu, Mar 20, 2014 at 9:11 AM, Doug Blank <doug.blank at gmail.com> wrote:

> I can confirm that this does not work as expected:
>
> from IPython.html.widgets import AccordionWidget, ButtonWidget
> aw = AccordionWidget(children=[ButtonWidget()])
> aw
>
> while this does:
>
> from IPython.html.widgets import TabWidget, ButtonWidget
> tw = TabWidget(children=[ButtonWidget()])
> tw
>
> -Doug
>
> On Wed, Mar 19, 2014 at 10:04 AM, Winters, Kevin D  ERDC-RDE-CHL-MS
> <Kevin.D.Winters at erdc.dren.mil> wrote:
> > I'm attempting to use an accordion widget in my notebook, however I can't
> > get the contents to display. I assumed that the AccordionWidget should be
> > defined similarly to the TabWidget. Here's my test code:
> >
> > from IPython.html import widgets # Widget definitions
> > from IPython.display import display # Used to display widgets in the
> > notebook
> >
> > acc = widgets.AccordionWidget()
> > #acc = widgets.TabWidget()
> >
> > this = widgets.ContainerWidget()
> > this.children = [widgets.CheckboxWidget(description='this', value=True)]
> > that = widgets.ContainerWidget()
> > that.children = [widgets.CheckboxWidget(description='that', value=False)]
> >
> > acc.children = [this, that]
> > dictPages = {0:'This', 1:"That"}
> >
> > display(acc)
> > acc.set_css({'border':'3px solid black', 'height':'500px',
> 'width':'500px'})
> > for page in dictPages:
> >     acc.set_title(page, dictPages[page])
> > for page in acc.children:
> >     page.set_css({'height':'150px'})
> > acc.selected_index = 1
> >
> > Am I missing something or is there a bug in the accordion display?
> >
> > Thanks,
> >
> > Kevin
> > --------------------
> > Kevin Winters
> > Research Hydraulic Engineer
> > US Army Corps of Engineers
> > Engineer Research and Development Center
> > 3909 Halls Ferry Road
> > Vicksburg, MS 39180
> > 601.634.2102
> >
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
> >
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140320/ecaac194/attachment.html>


More information about the IPython-dev mailing list