Skip to content

How to solve dendencies between widget? #26

@schoenid

Description

@schoenid

I've got the situation, where I want to get a widgets selection, depending on the state of another widget.

Example:

Settings:

...
settings = { # inside the class, as self.settings
    "a": [1, 2, 3,],
    "b": [False, True,],
    "c": ["X", "Y", "Z",],
    }
...

Widgets:

...
"selection": (s.settings[choice], {}), # in INPUT_TYPES definition
"choice": (["a", "b", "c", ], {"default": "a",}),
...

Dependig on "choice" the "selection" widget should allow to select between

  • 1, 2, 3
  • False, True
  • X, Y, Z

This definition doesn't work, because the choice key for the selection can't be defined that way. However, I don't know any other way, to do that.
How can this be solved, in a short, efficient way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions