kivy

Python Kivy ListView: How to delete selected ListItemButton?

有些话、适合烂在心里 提交于 2020-01-30 12:26:06
问题 I'm trying to learn kivy by building a simple todo-list app like suggested by Dusty Phillips, author of the book "Creating apps in Kivy". This is the code so far: from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty from kivy.uix.listview import ListItemButton class TaskButton(ListItemButton): pass class TodoRoot(BoxLayout): task_input = ObjectProperty() task_list = ObjectProperty() def add_task(self): self.task_list.adapter.data.extend(

Python KivyMD: How can I make the toggle_nav_drawer() function work?

让人想犯罪 __ 提交于 2020-01-30 11:23:12
问题 I got a problem with my kv code here. I want to create a MDNavigationDrawer with a few NavigationDrawerIconButtons . The window shows up but when I click at the MDToolbar the program crashes and shows this Error Message. Traceback (most recent call last): File "C:/Users/path/to/my/file/main.py", line 189, in <module> KivyGUI().run() File "C:\Users\uname\Anaconda3\lib\site-packages\kivy\app.py", line 855, in run runTouchApp() File "C:\Users\uname\Anaconda3\lib\site-packages\kivy\base.py", line

kivy custom widget bind error

99封情书 提交于 2020-01-30 05:14:31
问题 I am trying to make a small tetris game for learning python with kivy. I am trying to create a custom widget with size 20,20. When I add it to the float layout and run the below code I receive the following error: Error: File "D:\OS Files\workspace\Tetris\holder.py", line 10, in __init__ self.add_widget(c) File "C:\Kivy180\kivy\kivy\uix\floatlayout.py", line 115, in add_widget pos_hint=self._trigger_layout) TypeError: descriptor 'bind' of 'kivy._event.EventDispatcher' object needs an argument

How can you initialise an instance in a Kivy screen widget

心不动则不痛 提交于 2020-01-26 04:58:29
问题 I am trying to access an instance variable named self.localId in my kivy screen and it keeps saying the saying the instance doesn't exist after i have initialised it. I know I have an error In my code but im having a hard time identifying it. is there a different way to initialising instances in a kivy screen? but here is my code. I would appreciate any help mainfile.py from kivy.app import App import requests import json from kivy.uix.screenmanager import Screen, ScreenManager from kivy.lang

Why does Buildozer show `# Aidl not found, please install it.` even after I installed it?

拈花ヽ惹草 提交于 2020-01-25 21:19:07
问题 I have installed build-essential, libstdc++6,and, aidl itself: sudo apt-get install aidl Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: aspectj eclipse-platform-data eclipse-rcp fastjar fping jarwrapper junit4 kivy-doc kivy-tools libasm3-java libasm4-java libaspectj-java libcglib3-java libcommons-cli-java libcommons-codec-java libcommons-httpclient-java libeasymock-java

How can I enable the button in kivy which is disabled before?

試著忘記壹切 提交于 2020-01-25 16:37:08
问题 : canvas: Color: rgb: 1, 1, 1 Rectangle: source: "bbbg.png" size: self.size BoxLayout: orientation: 'vertical' Button: #pos_hint: {'center': .01} #size_hint_x: 1 #size_hint_y: 0.07 #size_hint_x: 0.07 disabled:True pos_hint: {'center': 0} background_color: 1,1,1,0 on_release: root.manager.current = 'select_next' on_press: app.nextbtn(self) source: None name:"" Image: size: 540, 540 center: self.parent.center allow_stretch: True source: "playbutton.png" 回答1: Get a reference to the button, and

How can I enable the button in kivy which is disabled before?

假装没事ソ 提交于 2020-01-25 16:36:47
问题 : canvas: Color: rgb: 1, 1, 1 Rectangle: source: "bbbg.png" size: self.size BoxLayout: orientation: 'vertical' Button: #pos_hint: {'center': .01} #size_hint_x: 1 #size_hint_y: 0.07 #size_hint_x: 0.07 disabled:True pos_hint: {'center': 0} background_color: 1,1,1,0 on_release: root.manager.current = 'select_next' on_press: app.nextbtn(self) source: None name:"" Image: size: 540, 540 center: self.parent.center allow_stretch: True source: "playbutton.png" 回答1: Get a reference to the button, and

How to build kivy and Twisted in Buildozer

痞子三分冷 提交于 2020-01-25 08:24:46
问题 I am working on my first app, and I added twisted to the app via the kivy support function kivy.support.install_twisted_reactor. It works well in my development environment, but I can't get my buildozer settings right to get twisted to compile properly with the app. Any ideas as to which minimum settings are mandatory to get buildozer to compile twisted properly? I tried simply adding "twisted" to the requirements section, but clearly that's not enough... I could share my code, but I am

No name 'ObjectProperty' in module 'kivy.properties'

大城市里の小女人 提交于 2020-01-25 06:38:05
问题 I want to write a small App with kivy but when I try to import from kivy.properties import ObjectProperty I get the error: No name 'ObjectProperty' in module 'kivy.properties'pylint(no-name-in-module) All the other imports of kivy are working. I also started the app with some other code and it worked fine. I am working on vscode if it helps 来源: https://stackoverflow.com/questions/57637558/no-name-objectproperty-in-module-kivy-properties

kivy - Trying to load a video gets a gstreamer error

筅森魡賤 提交于 2020-01-25 02:30:11
问题 I'm new in kivy and I'm working in OSX. I'm trying to implement a simple example of playing a video using the Video class from kivy.uix.video in this way: Video: id: video source: 'resources/videos/testVideo.mpg' state: 'play' But I get this error: kivy.lib.gstplayer._gstplayer.GstPlayerException: Unable to create a playbin I'm certain that gstreamer is correctly installed. I have the 1.6.2.0 version. Can someone help me with this? I've been trying to research on this error, and seems that is