Hi Guys I have a question about kivy DropDown
. I have this example:
def dropdownbutton(self):
dropdown = DropDown()
classlist = ['Barbarian', 'Knight', 'Sorcerer', 'Typical Seba', 'Hunter']
for index in classlist:
btn = Button(text='%s' % index, size_hint_y=None, height=44)
btn.bind(on_release=lambda btn: dropdown.select(btn.text))
dropdown.add_widget(btn)
mainbutton = Button(text='Class', size_hint=(None, None))
mainbutton.bind(on_release=dropdown.open)
dropdown.bind(on_select=lambda instance, x: setattr(mainbutton, 'text',
x))
return mainbutton
And what I want to do, is to track current btn.txt
which I choose, mby its dumb, but I spend about hour on this... Can you help me?
btn.text
returns me Hunter
all the time