Skip to content

SelectionList empty #5415

Closed Answered by TomJGooding
AndyDralle asked this question in Q&A
Dec 20, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The problem is that you're trying to compose a SelectionList inside another SelectionList, which isn't going to work.

If you want your widget to be a subclass of SelectionList, you can initialize it using super().__init__() and pass in your options:

class MySelectionList(SelectionList):
    def __init__(self) -> None:
        selections = [("First", 1), ("Second", 2)]
        super().__init__(*selections)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AndyDralle
Comment options

Answer selected by AndyDralle
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