Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The list of options in a selector can't be updated after initialisation #42

Open
caoimhebyrne opened this issue Apr 3, 2022 · 0 comments

Comments

@caoimhebyrne
Copy link
Member

When defining a selector like shown below, once it's defined, the list of options stays the same, even if it's changed later on.

val options = listOf("1", "2", "3")

init {
    selector(
        ::foo,
        "Foo",
        "Bar",
        options = options
    )
    ...
}

It might be a good idea to be able to update a selector's list, as I can think of many cases where a data set may change over time.

One solution is passing options by a field reference, and then checking that field each time the configuration GUI is shown:

selector(
    ...
    options = ::options
)

This is open to suggestion, and I'd like to see what other people think is a viable solution to this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant