If you add a Knob and try to bind a callback using the method shown in the example, it will fail:
self.test_screen.slider1.bind(on_touch_move = self.on_slider)
self.test_screen.knob1.bind(on_touch_move = self.on_knob)
This works for sliders but fails on knobs. Instead I need to do an awkward workaround:
for c in self.test_screen.widgets:
if (type(c) == Knob):
c.bind(on_touch_move = self.on_knob)
And then figure out which knob in the callback using knob.label.text. Is there a cleaner way of doing this?
If you add a Knob and try to bind a callback using the method shown in the example, it will fail:
This works for sliders but fails on knobs. Instead I need to do an awkward workaround:
And then figure out which knob in the callback using
knob.label.text. Is there a cleaner way of doing this?