<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
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:
<div><br>
</div>
<div>
<div><i>from IPython.html import widgets # Widget definitions</i></div>
<div><i>from IPython.display import display # Used to display widgets in the notebook</i></div>
<div><i><br>
</i></div>
<div><i>acc = widgets.AccordionWidget()</i></div>
<div><i>#acc = widgets.TabWidget()</i></div>
<div><i><br>
</i></div>
<div><i>this = widgets.ContainerWidget()</i></div>
<div><i>this.children = [widgets.CheckboxWidget(description='this', value=True)]</i></div>
<div><i>that = widgets.ContainerWidget()</i></div>
<div><i>that.children = [widgets.CheckboxWidget(description='that', value=False)]</i></div>
<div><i><br>
</i></div>
<div><i>acc.children = [this, that]</i></div>
<div><i>dictPages = {0:'This', 1:"That"}</i></div>
<div><i><br>
</i></div>
<div><i>display(acc)</i></div>
<div><i>acc.set_css({'border':'3px solid black', 'height':'500px', 'width':'500px'})</i></div>
<div><i>for page in dictPages:</i></div>
<div><i>    acc.set_title(page, dictPages[page])</i></div>
<div><i>for page in acc.children:</i></div>
<div><i>    page.set_css({'height':'150px'})</i></div>
<div><i>acc.selected_index = 1</i></div>
<div><br>
</div>
<div>Am I missing something or is there a bug in the accordion display?</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Kevin</div>
<div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; ">-------------------- <br>
Kevin Winters<br>
Research Hydraulic Engineer<br>
US Army Corps of Engineers<br>
Engineer Research and Development Center<br>
3909 Halls Ferry Road<br>
Vicksburg, MS 39180<br>
601.634.2102</span> </div>
<br>
</div>
</body>
</html>