Skip to content
Discussion options

You must be logged in to vote

Many widgets, where you can make some sort of selection or take some sort of action, use messages and message handlers. OptionList is one such widget. Assuming you want to do something with the chosen item when the user pressed Enter, or similar, you want to be working with the OptionSelected event, which in turn is a version of the general OptionMessage message.

You'll notice that it has an option_index attribute. This will contain the index of the option that was selected.

As mentioned in the documentation for OptionSelected, you'll use a on_option_list_option_selected message handler to receive that message.

So, taking the first example in the documentation for OptionList and building …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@totordev
Comment options

@totordev
Comment options

@davep
Comment options

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

This discussion was converted from issue #2375 on April 25, 2023 19:20.