You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PushButton widget has an args parameter that can be used to send arguments to the command function. The slider widget, for example, also supports a command function, so it would make sense if it also supports args.
An example use case would be for a list of similar things, each needing a slider and a button. These could be added in a loop. Each button can use the same command function, and by giving the iterator index in the args the button can be identified. I want to be able to do tat with the slider.
Also applies to ListBox, TextBox, CheckBox, Combo.
The text was updated successfully, but these errors were encountered:
A lambda is a reasonable approach. But I would suggest updating the docs to say you can do that. Currently says "The name of a function to call when the slider value is changed". some example code as you do in your response would also be very useful.
If you want to consider this closed, I have no problem with that.
. updating the docs to reflect the use of lambda when passing arguments to callbacks
. deprecating the use of args - this maybe more controversial @lawsie - thoughts?
The PushButton widget has an args parameter that can be used to send arguments to the command function. The slider widget, for example, also supports a command function, so it would make sense if it also supports args.
An example use case would be for a list of similar things, each needing a slider and a button. These could be added in a loop. Each button can use the same command function, and by giving the iterator index in the args the button can be identified. I want to be able to do tat with the slider.
Also applies to ListBox, TextBox, CheckBox, Combo.
The text was updated successfully, but these errors were encountered: