ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 17 Jan 2012 17:36:11 +0100Interact depending on other argumentshttps://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/Hello,
Is it possible to have interact arguments depend on one another? For example, having the maximum of one slider depend on the former? I tried this:
<pre>@interact
def metacontrol(a=slider(5,10)):
@interact
def control(b=slider(0, a)):
pass
</pre>
But it doesn't work; updating the first slider deletes the second slider. It is possible with two cells, but this requires executing the cell which defeats the purpose of interact.
Thank you.Sat, 18 Dec 2010 02:05:41 +0100https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/Answer by kcrisman for <p>Hello,</p>
<p>Is it possible to have interact arguments depend on one another? For example, having the maximum of one slider depend on the former? I tried this:</p>
<pre>@interact
def metacontrol(a=slider(5,10)):
@interact
def control(b=slider(0, a)):
pass
</pre>
<p>But it doesn't work; updating the first slider deletes the second slider. It is possible with two cells, but this requires executing the cell which defeats the purpose of interact.</p>
<p>Thank you.</p>
https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/?answer=11866#post-id-11866This is already [Ticket 3836](http://trac.sagemath.org/sage_trac/ticket/3836) on Trac, I think. No, it's not yet possible. The interacts will have a lot changed over the next two years with the new NSF grant, though, so this is certainly a possible change during that time.Sat, 18 Dec 2010 20:19:13 +0100https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/?answer=11866#post-id-11866Comment by kcrisman for <p>This is already <a href="http://trac.sagemath.org/sage_trac/ticket/3836">Ticket 3836</a> on Trac, I think. No, it's not yet possible. The interacts will have a lot changed over the next two years with the new NSF grant, though, so this is certainly a possible change during that time.</p>
https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/?comment=20515#post-id-20515See http://ask.sagemath.org/question/1061 for an update on this! Tue, 17 Jan 2012 17:36:11 +0100https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/?comment=20515#post-id-20515Comment by Eviatar Bach for <p>This is already <a href="http://trac.sagemath.org/sage_trac/ticket/3836">Ticket 3836</a> on Trac, I think. No, it's not yet possible. The interacts will have a lot changed over the next two years with the new NSF grant, though, so this is certainly a possible change during that time.</p>
https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/?comment=22383#post-id-22383Thank you. Once that gets implemented, interact will be much more powerful.Sun, 19 Dec 2010 14:19:05 +0100https://ask.sagemath.org/question/7821/interact-depending-on-other-arguments/?comment=22383#post-id-22383