GithubHelp home page GithubHelp logo

Comments (3)

HeaTTheatR avatar HeaTTheatR commented on June 10, 2024

@gbm001 This error does not play on my computer. Give a minimal example that reproduces this problem.

from kivymd.

gbm001 avatar gbm001 commented on June 10, 2024

testapp.py:
(if I don't add the ThemeManager bit it crashes with a different error)

import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivymd.theming import ThemeManager

class TestAppBase(BoxLayout):
    pass

class TestApp(App):

    # KivyMD theme
    theme_cls = ThemeManager()

    def build(self):
        self.base = TestAppBase()
        return self.base  # Root widget

TestApp().run()

testapp.kv:

#:kivy 1.11.0

#:import MDSwitch kivymd.selectioncontrols.MDSwitch

<TestAppBase>:
    MDSwitch:
        disabled: True

Crashes with:

 Traceback (most recent call last):
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 619, in _apply_rule
     setattr(widget_set, key, value)
   File "kivy/weakproxy.pyx", line 33, in kivy.weakproxy.WeakProxy.__setattr__
   File "kivy/properties.pyx", line 483, in kivy.properties.Property.__set__
   File "kivy/properties.pyx", line 1468, in kivy.properties.AliasProperty.set
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 1331, in set_disabled
     self.inc_disabled()
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 1339, in inc_disabled
     self.property('disabled').dispatch(self)
   File "kivy/properties.pyx", line 1472, in kivy.properties.AliasProperty.dispatch
   File "kivy/properties.pyx", line 1474, in kivy.properties.AliasProperty.dispatch
   File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
   File "kivy/_event.pyx", line 1096, in kivy._event.EventObservers._dispatch
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 73, in call_fn
     e_value = eval(value, idmap)
   File "<string>", line 55, in <module>
   File "kivy/weakproxy.pyx", line 30, in kivy.weakproxy.WeakProxy.__getattr__
 AttributeError: 'MDSwitch' object has no attribute 'thumb_color_disabled'
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
   File "./testapp.py", line 18, in <module>
     TestApp().run()
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/app.py", line 800, in run
     root = self.build()
   File "./testapp.py", line 15, in build
     self.base = TestAppBase()
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/boxlayout.py", line 131, in __init__
     super(BoxLayout, self).__init__(**kwargs)
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/layout.py", line 76, in __init__
     super(Layout, self).__init__(**kwargs)
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 348, in __init__
     Builder.apply(self, ignored_consts=self._kwargs_applied_init)
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 469, in apply
     self._apply_rule(widget, rule, rule, ignored_consts=ignored_consts)
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 630, in _apply_rule
     e), cause=tb)
 kivy.lang.builder.BuilderException: Parser: File "/home/amcleod/android/tests/testapp.kv", line 7:
 ...
       5:<TestAppBase>:
       6:    MDSwitch:
 >>    7:        disabled: True
 ...
 AttributeError: 'MDSwitch' object has no attribute 'thumb_color_disabled'
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 619, in _apply_rule
     setattr(widget_set, key, value)
   File "kivy/weakproxy.pyx", line 33, in kivy.weakproxy.WeakProxy.__setattr__
   File "kivy/properties.pyx", line 483, in kivy.properties.Property.__set__
   File "kivy/properties.pyx", line 1468, in kivy.properties.AliasProperty.set
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 1331, in set_disabled
     self.inc_disabled()
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/uix/widget.py", line 1339, in inc_disabled
     self.property('disabled').dispatch(self)
   File "kivy/properties.pyx", line 1472, in kivy.properties.AliasProperty.dispatch
   File "kivy/properties.pyx", line 1474, in kivy.properties.AliasProperty.dispatch
   File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch
   File "kivy/_event.pyx", line 1096, in kivy._event.EventObservers._dispatch
   File "/home/amcleod/.local/lib/python3.6/site-packages/kivy/lang/builder.py", line 73, in call_fn
     e_value = eval(value, idmap)
   File "<string>", line 55, in <module>
   File "kivy/weakproxy.pyx", line 30, in kivy.weakproxy.WeakProxy.__getattr__

from kivymd.

gbm001 avatar gbm001 commented on June 10, 2024

Fixed for me as well; thanks :)

from kivymd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.