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

MDSegmentButtonIcon class can't be initialized #1741

Open
JosselinDb opened this issue Sep 23, 2024 · 0 comments
Open

MDSegmentButtonIcon class can't be initialized #1741

JosselinDb opened this issue Sep 23, 2024 · 0 comments

Comments

@JosselinDb
Copy link

KivyMD version: 2.0.1.dev0

I've found that MDSegmentedButtonIcon works well with the KV Builder, but fails when trying to initialize it inside the class.

To reproduce:

from kivymd.app import MDApp

from kivymd.uix.screen import MDScreen
from kivymd.uix.segmentedbutton import (
    MDSegmentedButton,
    MDSegmentButtonLabel,
    MDSegmentButtonIcon,
    MDSegmentedButtonItem,
)


class Example(MDApp):
    def build(self):
        screen = MDScreen()

        segmented_button = MDSegmentedButton(
            MDSegmentedButtonItem(
                MDSegmentButtonIcon(icon="language-python"),
                MDSegmentButtonLabel(text="Python"),
            ),
            MDSegmentedButtonItem(
                MDSegmentButtonIcon(icon="language-javascript"),
                MDSegmentButtonLabel(text="Javascript"),
            ),
        )
        screen.add_widget(segmented_button)

        return screen


Example().run()

error seems to occur in the builder, can't exactly say where it fails

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