Trying to add some buttons with a for-loop to a container that is already defined in the .kv file:
The code looks like this:
a_list = ["Spam", "Eggs"]
for i in range(len(a_list)):
self.ids.container.add_widget(
ThreeLineListItem(id = a_list[i], text= "Some info ",
secondary_text = "More info",
tertiary_text = "Final info",
on_release=lambda x: print_me(self.id))
)
def print_me(the_id):
print(the_id)
This just prints "None", how come? And how to fix it so the first button prints "Spam" on release and the second one "Eggs"?