Skip to content

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

@caoimhebyrne

Description

@caoimhebyrne

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions