<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 18, 2014 at 3:25 AM, Akim Demaille <span dir="ltr"><<a href="mailto:akim@lrde.epita.fr" target="_blank">akim@lrde.epita.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>[Resend: I sent the message without having subscribed, and my</div>
<div>message never showed up, and I never received a message telling</div><div>me that I needed to be member to post.  The info page of the list</div><div>does not mention that either, I think it should.]</div><div><br></div>
Hi all,<div><br></div><div>I'm working on an interactive (textual) means to edit an automaton</div><div>in the notebooks.  It looks like this:</div><div><br></div><div><img height="418" width="595" src="cid:8A9D00E4-849B-42FA-961C-35A0C4BCD530"></div>
<div><br></div><div>I'm using a TextareaWidget to let the user type in her automaton,</div><div>and an HTMLWidget for te SVG output from dot.  It is interactive</div><div>in that I use on_trait_change on the text area to decide whether</div>
<div>to update the output.</div><div><br></div><div>I have two questions: is there a simple means to control the frequency</div><div>of the updates?  When the user is typing, I don't need to receive all</div><div>the updates, waiting for a quiet period should be enough.  But this</div>
<div>I guess I can't do by myself, don't worry.</div><div><br></div><div>My real question is: I'd like to avoid the text area and rather</div><div>have a cell magic that would look like:</div><div><br></div><div>
<img height="317" width="595" src="cid:EEE60C52-34D1-4279-962B-4DE5B122AAAD"></div><div><br></div><div>I can easily do that with usual cell magic functions, but I'd like</div><div>to have auto evaluation, so that we don't have to wait for the user</div>
<div>to hit shift-enter.  Is there a means to do that?</div></div></blockquote><div><br></div><div>Cool project! "Live coding" for Finite State Machines!</div><div><br></div><div>There probably a few places you could insert JavaScript into the keypress handling process. Perhaps an easy way would be to add a CodeMirror overlay [1]. You could not only fire your code to check to see if you want to re-render the dot output, but could also add some custom parsing for your language.</div>
<div><br></div><div>When you have a complete description, you can probably call something like the JavaScript IPython.notebook.get_cell(n).execute().</div><div><br></div><div>Hope that helps,</div><div><br></div><div>-Doug</div>
<div><br></div><div>[1] <a href="http://stackoverflow.com/questions/12343922/codemirror-with-spell-checker">http://stackoverflow.com/questions/12343922/codemirror-with-spell-checker</a> - the last answer I just added which works inside an notebook.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div>
<div>Thanks in advance!</div></div><br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">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>