In the code below the function ‘toggle_is_running’ is never called when pressing the toggle button, but when I remove the ‘widgets’ spec or change it to ‘Checkbox’, it works as expected. They are both just boolean widgets so I don’t get it.
class TimeControlPanel(param.Parameterized):
is_running = param.Boolean(default=False, label='\u25b6')
def __init__(self, **params):
super().__init__(**params)
def view(self):
widgets={'is_running': pn.widgets.Toggle}
return pn.Param(self.param, widgets=widgets)
@param.depends('is_running', watch=True)
def toggle_is_running(self):
# do stuff