Closed typemytype closed 4 years ago
isContinuous
(adjective not adverb :)
In vanilla this is always called continuous
. But what does this do different from specifying continuous
in args
?
a vanilla.Slider
has continuous
which means the callback is not called while sliding, only on mouse up...
isContinuous
in a Variable dict item is a bit different as it the callback would be ignored completely for that ui control.
Can you explain when that behavior use useful?
when a script is heavy it makes no sense to have it updating for every tiny slider drag
see https://forum.drawbot.com/topic/257/ui-with-update-function
True. But I think that should be a function of the entire thing, not each individual UI item.
with this you can choose that your colorWel will update, but not the slider...
and I didnt wanted to add more arguments in the Variables
method
But if it doesn't make sense for a slider to update live, it doesn't make sense for the color well to update live.
Variable
only takes two argument, what's against adding an argument there?
I would a third one isContinuous
, that when False, adds an "Update" button at the bottom of the window, and changes the overall behavior to "not continuous".
Imagine you have a bunch of stuff set up with Variable
(btw. shouldn't it be called Variables
? I always wondered that). At some point the script becomes too slow for it to behave continuously. It would be silly if the user would need to change all Slider items to be not continuous.
True
I'm also not convinced that needing an explicit update button is the way to go. What's wrong with doing an implicit update on mouse-up? Like as if Slider has continuous
set to True.
I would love the possibility for Variable
to simply pass continuous=True
to all UI elements that support it, with one flag.
changed by adding a button, a button makes sense so multiple sliders can be changed and single click.
the vanilla argument can always be passed in the args
of an ui item
dict(name="foo" ui="Slider", args=dict(continuous=False))
(mabye this dicussion should happen in the PR)
add an option to switch off the callback for ui elements, proposal add
isContinuously
(default toTrue
to keep the current behaviour.