Skip to content
Discussion options

You must be logged in to vote

Options within an OptionList don't have a value. The idea behind OptionList is that it's a list of prompts (options) that the user can select from, and when you have the index of a selection option you can decide to do something with that. For example, you maybe maintaining a parallel list of values and the index can be used to retrieve the value from that.

If you wanted to keep a value along with an Option in an OptionList the thing to do would be to subclass Option for your own needs and then add appropriate properties. For example, in a personal library I maintain, I used OptionList as the heart of a filesytem entry picking dialog, and I inherit from Option and add lots of properties f…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@MohamedElgamal
Comment options

@davep
Comment options

Answer selected by MohamedElgamal
@TomJGooding
Comment options

@MohamedElgamal
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
4 participants