.. and the kvlang
Send me the code.
I have been trying a lot to figure out how to use a separate kv file to define the UI. Below is the error traceback which I'm getting after running.
Traceback (most recent call last):
File "C:/Users/Pavitra/PycharmProjects/ComponentCreator/main.py", line 59, in <module>
CreatorApp().run()
File "C:\Python36\lib\site-packages\kivy\app.py", line 801, in run
self.load_kv(filename=self.kv_file)
File "C:\Python36\lib\site-packages\kivy\app.py", line 598, in load_kv
root = Builder.load_file(rfilename)
File "C:\Python36\lib\site-packages\kivy\lang\builder.py", line 301, in load_file
return self.load_string(data, **kwargs)
File "C:\Python36\lib\site-packages\kivy\lang\builder.py", line 350, in load_string
parser = Parser(content=string, filename=fn)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 392, in __init__
self.parse(content)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 501, in parse
objects, remaining_lines = self.parse_level(0, lines)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 605, in parse_level
level + 1, lines[i:], spaces)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 605, in parse_level
level + 1, lines[i:], spaces)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 605, in parse_level
level + 1, lines[i:], spaces)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 664, in parse_level
if current_property[:3] == 'on_':
TypeError: 'NoneType' object is not subscriptable
@pavi2410 Not exactly.
Open a new issue.
Same issue here
Traceback (most recent call last):
File "C:/Users/Pavitra/PycharmProjects/ComponentCreator/main.py", line 59, in <module>
CreatorApp().run()
File "C:\Python36\lib\site-packages\kivy\app.py", line 801, in run
self.load_kv(filename=self.kv_file)
File "C:\Python36\lib\site-packages\kivy\app.py", line 598, in load_kv
root = Builder.load_file(rfilename)
File "C:\Python36\lib\site-packages\kivy\lang\builder.py", line 301, in load_file
return self.load_string(data, **kwargs)
File "C:\Python36\lib\site-packages\kivy\lang\builder.py", line 350, in load_string
parser = Parser(content=string, filename=fn)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 392, in __init__
self.parse(content)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 501, in parse
objects, remaining_lines = self.parse_level(0, lines)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 605, in parse_level
level + 1, lines[i:], spaces)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 605, in parse_level
level + 1, lines[i:], spaces)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 605, in parse_level
level + 1, lines[i:], spaces)
File "C:\Python36\lib\site-packages\kivy\lang\parser.py", line 664, in parse_level
if current_property[:3] == 'on_':
TypeError: 'NoneType' object is not subscriptable
Code to test:
import threading
import time
import kivy
from kivy.lang.builder import Builder
from kivy.app import App
from kivy.clock import Clock, mainthread
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivymd.list import ThreeLineIconListItem, ILeftBody
from kivymd.button import MDIconButton
from kivymd.theming import ThemeManager
Builder.load_string("""
<Test>
BoxLayout:
id: blist
""")
class SideIcon(ILeftBody, MDIconButton): pass
class Test(App):
theme_cls = ThemeManager()
def start_widget_thread(self, *args):
threading.Thread(target=self.add_bunch_of_widgets).start()
def add_bunch_of_widgets(self):
wlist = []
for x in range(100):
#l = Label(text="Hellow "+str(x))
#l.add_widget(Widget())
l = ThreeLineIconListItem(text="Hellow"+str(x))
l.add_widget(SideIcon())
wlist.append(l)
self.actually_add(wlist)
@mainthread
def actually_add(self, wlist):
self.root.clear_widgets()
for w in wlist:
self.root.add_widget(w)
def build(self):
Clock.schedule_interval(self.start_widget_thread, 5)
if __name__=="__main__":
app = Test()
app.run()
Notice this does not occur with regular kivy objects, just the ones in this library.
How can I change the color of the text?
I was able to generate an APK for the kitchen_sink, I took it to an android device and it worked. I used the buildozer in the virtual machine. What are the procedures to generate for IOS? I use Windows 10.
This is not related to KivyMD
I was able to generate an APK for the kitchen_sink, I took it to an android device and it worked. I used the buildozer in the virtual machine. What are the procedures to generate for IOS? I use Windows 10.
Are you using Python 3 locally?
If not: Add hostpython2
to the requirements.
else: Add crystax3python
to the requirements.
I'm not sure if crystax3python works well with KivyMD, AFAIK it didn't work in the past.
I've been stuck with this for one month
I can't help you if you don't ask
Thank you. Now it worked, I took it to an android phone and it was okay? I believe I can now incorporate the KIVYMD package into my application. Congratulations !!!
Replace this in your buildozer.spec
# (str) Application versioning (method 1)
version = 0.1
# (str) Application versioning (method 2)
# version.regex = __version__ = ['\"]([^'\"]*)['\"]
# version.filename = %(source.dir)s/../../kivymd/__init__.py
Read what the error says, your filesystem is read-only.
This is a issue with VirtualBox at this point, so I'm going to close the issue.
How to install kivymd in virtualbox? I want to generate an APK from the kitchen example, but when I run the buildozer it gives an error.
I put it in virtualbox (assets, main.py, buildozer.spec)