Skip to content
Discussion options

You must be logged in to vote

You need to capture the value of users at the time each button is created:

for i, user in enumerate(settings["users"]):
     user_buttons[i] = ui.button(user['name'], on_click=lambda e, user=user: set_userto(user['id']))

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@falkoschindler
Comment options

Answer selected by falkoschindler
Comment options

You must be logged in to vote
2 replies
@falkoschindler
Comment options

@laserir
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #470 on March 08, 2023 12:58.