ToggleButton on_state programmatically?

Viewed 772

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.

1 Answers
Related