Reputation: 103
I'm making ToggleButtons programmatically and I want to set the on_state method, but it doesn't seem to work:
tbutton = uix.togglebutton.ToggleButton(multiline=True,markup=True,text=text,group="g",size_hint=(1,None))
tbutton.bind(on_state=self.my_function)
def my_function(self,*args):
print "TEST"
If I press the button nothing seems to work.
Upvotes: 2
Views: 874
Reputation: 8066
You should bind state - not on_state ...
tbutton.bind(state=self.my_function)
That it :)
Upvotes: 2