<div dir="ltr">Hi Nicholas,<div><br></div><div style>After I updated to the recent dev, part of our code broke.  It's from the part that you showed to us, so I figured you might be aware of what has been changed:<br><br><pre style="overflow:auto;font-size:14px;padding:0px;margin-top:0px;margin-bottom:0px;line-height:17px;word-break:break-all;word-wrap:break-word;color:rgb(0,0,0);background-color:rgb(255,255,240);border:0px;border-top-left-radius:0px;border-top-right-radius:0px;border-bottom-right-radius:0px;border-bottom-left-radius:0px;white-space:pre-wrap;vertical-align:baseline"><span class="" style="color:rgb(139,0,0)">AttributeError</span>                            Traceback (most recent call last)
<span class="" style="color:rgb(0,100,0)"><ipython-input-8-70485b3b7990></span> in <span class="" style="color:rgb(70,130,180)">displayed<span class="" style="color:rgb(0,0,139)">(self, _)</span>
<span class="" style="color:rgb(0,100,0)">    113</span>     <span class="" style="color:rgb(139,0,0)"># -----</span><span class="" style="color:rgb(196,160,0)"></span><span class="" style="color:rgb(196,160,0)"></span>
<span class="" style="color:rgb(0,100,0)">    114</span>     <span class="" style="color:rgb(0,100,0)">def</span> displayed<span class="" style="color:rgb(196,160,0)">(</span>self<span class="" style="color:rgb(196,160,0)">,</span> _<span class="" style="color:rgb(196,160,0)">)</span><span class="" style="color:rgb(196,160,0)">:</span><span class="" style="color:rgb(196,160,0)"></span>
<span class="" style="color:rgb(0,100,0)">--> 115<span class="" style="color:rgb(196,160,0)">         </span>self<span class="" style="color:rgb(196,160,0)">.</span>add_class<span class="" style="color:rgb(196,160,0)">(</span><span class="" style="color:rgb(0,0,139)">"col-xs-9"</span><span class="" style="color:rgb(196,160,0)">)</span><span class="" style="color:rgb(196,160,0)"></span>
<span class="" style>    116</span>         <span class="" style="color:rgb(139,0,0)"># THIS IS WHERE DRAW IS CALLED AFTER DISPLAYS CHANGE</span><span class="" style="color:rgb(196,160,0)"></span><span class="" style="color:rgb(196,160,0)"></span>
<span class="" style>    117</span>         self<span class="" style="color:rgb(196,160,0)">.</span>draw<span class="" style="color:rgb(196,160,0)">(</span><span class="" style="color:rgb(196,160,0)">)</span><span class="" style="color:rgb(196,160,0)"></span>

<span class="" style="color:rgb(139,0,0)">AttributeError</span>: 'Spectrogram' object has no attribute 'add_class'
</span></span></pre><div><span class="" style="color:rgb(70,130,180)"><span class="" style="color:rgb(0,100,0)"><br></span></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 28, 2014 at 12:07 AM, Adam Hughes <span dir="ltr"><<a href="mailto:hughesadam87@gmail.com" target="_blank">hughesadam87@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ah gotcha!  Thanks for clearing that up, much appreciated!  I guess my dev is way older than I recall.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 10:45 PM, Nicholas Bollweg <span dir="ltr"><<a href="mailto:nick.bollweg@gmail.com" target="_blank">nick.bollweg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>For reference, I see this:<br><br><img alt="Inline image 3" src="cid:ii_14954a313d677558" height="201" width="520"><br><br>ah, the _dom_classes may have been more recent than that. Here's the change, landed sept 23: <a href="https://github.com/ipython/ipython/pull/6235" target="_blank">https://github.com/ipython/ipython/pull/6235</a><br><br>you may have to go back to something like:<br></div><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">w = HTML("text")<br>w.on_displayed(lambda x: w.add_class("alert-warning")<br></blockquote><br></div>When you want to change it, you'd then have to:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">w.remove_class("alert-warning")<br>w.add_class("alert-success")<br></blockquote><div><br></div><div>In the new core widgets, a traitlet manages these directly:<br><a href="https://github.com/ipython/ipython/blob/master/IPython/html/widgets/widget_button.py#L36" target="_blank">https://github.com/ipython/ipython/blob/master/IPython/html/widgets/widget_button.py#L36</a><br></div><div>And all the class adding/removing is done on the client side.<br></div><div><br>In my <a href="https://github.com/bollwyvl/ip-bootstrap" target="_blank">bootstrap librar</a>y i have been tinkering with, I did the same, though a little differently.<br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 8:55 PM, Adam Hughes <span dir="ltr"><<a href="mailto:hughesadam87@gmail.com" target="_blank">hughesadam87@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, but when you do this in your notebook, does it appear in a different colors?  Mine looks like plain text.  IE I literally see:<div><br></div><div><div style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px">info</div><div style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px">danger</div><div style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px">warning</div><div style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px">success</div></div><div style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px"><br></div><div style="color:rgb(0,0,0);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;line-height:20px">In my output cell, instead of pretty colors like the example on the bootstrap link.  Using about a 2week-old version of 3.0 dev, if that matters.</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Oct 27, 2014 at 8:50 PM, Nicholas Bollweg <span dir="ltr"><<a href="mailto:nick.bollweg@gmail.com" target="_blank">nick.bollweg@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">right, you'd switch it out to another context:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">from IPython.html import widgets<br>from IPython.display import display<br>for context in ["info", "danger", "warning", "success"]:<br>    display(widgets.HTML(value=context, _dom_classes=["alert", "alert-" + context]))<br></blockquote></div>
<br></div></div><span>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></span></blockquote></div><br></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>