On Mon, Jan 26, 2009 at 1:51 PM, john_perry_usm <john....@usm.edu> wrote:
> I'll post this to sage-support too, but I'm writing it here to ask
> whether people think that this should be a *default* widget that is
> included with *every* Sage interact. It's not a great solution, but it
> could be a start...?
How about having it so that if you have interact_update=False in the
parameter list, then things won't automatically update when the
controls are changed. Instead, there'd just be a button labeled
"Update" that appears which will rerun the function when it is
clicked?
--Mike
That's an excellent idea, and probably very easy to implement too.
William
How about this slight change in syntax:
@interact(update=False)
def _(...
Jason
If you wanted to do this, and still support the regular @interact
(with no parens) syntax, then you'll need to make a pretty
awkward/convoluted construction in order support both.
As the functions parameters already affect how interact works, I don't
think an interact_update=False would be that surprising.
--Mike
+1 to this; Mike speaks from having a very strong sense for how decorators
work in Python.
Personally, I would prefer update=False. It would be easier to
remember than interact_update, which is rather long.
By the way, it's about time figure out how to specify more precisely
layout information for controls. Any proposals for the syntax for
this. I've cc'd Igor Tolkov, who once suggested something to me last
summer (he did a Google-funded project on @interact last summer --
thanks Google!).
William