kivy

Add a Matplotlib Graph to a Widget in KivyMD

风流意气都作罢 提交于 2021-01-29 15:45:09
问题 I am currently creating a mobile app with KivyMD which serves for managing travel expense requests. The user will enter a desired requested amount for different types of expenses on an MDTextField. I want to add a donut graph made with patplotlib into an MDBoxLayout. Such graph should automatically update as the request is filled. (For clarity I will include a screenshot. The square in red is the desired location for my graph). I created a method called update_method_graph and used fixed

Interaction and Deletion among widgets on Python + KivyMD and Code Optimization

北城余情 提交于 2021-01-29 14:58:56
问题 I am currently building an app that serves as a travel expenses manager. I have a system in which the user writes the desired amount of the expense on an MDTextField, such expense will be recorded in an MDList and the total amount of requested expenses will be added to an MDTextField. For clarity I will post a screen shot: All this system works correctly so far. However, there can be mistakes made by the user. I want the user to be able to delete an item from the MDList when the trash-can

Open kivy popup before continuing

早过忘川 提交于 2021-01-29 13:41:49
问题 My kivy popup does not appear on the screen until the rest of the code in my method finishes running. I am trying to display a progress bar so it is worthless in it's current state. I have tried to thread the process to open the popup and tried without threading. from kivy.uix.progressbar import ProgressBar from kivy.uix.popup import Popup import threading def submit(): popup = Popup(title='Submit Progress', content=ProgressBar()) thread_object = threading.Thread(target=popup.open) thread

Is there a focus lost event dispatcher for a kivy TextInput?

扶醉桌前 提交于 2021-01-29 13:34:34
问题 Problem: Is there a way to fire an event if a multiline = True TextInput lost its focus? Background: I have tried on_touch_up function. But it returns the instances of all my TextInputs , not just the current widget. I tried text_validate_unfocus = False , with the same result. Code: import kivy kivy.require("1.10.1") from kivy.app import App from kivy.uix.floatlayout import FloatLayout from kivy.properties import ObjectProperty, NumericProperty from kivy.uix.textinput import TextInput from

Why Kivy doesn't allow multiprocessing precess to terminate in Python?

烈酒焚心 提交于 2021-01-29 13:29:12
问题 I'm creating my first app, and I've found this problem with Kivy: When I use multiprocessing in a Kivy app, the processes I created are immune to ".terminate()". Same code, but outside an app, works fine. What am I doing wrong? Here I attach some code: from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import Screen import multiprocessing import time from plyer import tts kv = Builder.load_file("testup.kv") class TestScreen(Screen): def speech(self): for i in

Kivy: How to change 'Spinner' button colour and size?

末鹿安然 提交于 2021-01-29 11:42:32
问题 I'm looking for a way to specify button colour and button size in Spinner widget. I want to specify about not main(shown) button but drop-down-list button . It seems that Spinner widget probably only has API to specify about main(shown) button. How can I change colour and size of my spinner? import kivy from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen from kivy.uix.spinner import Spinner class SpinnerWidget(Spinner): def __init__(self, **kwargs): super

triggering Popup.dismiss() in a method which didn't call Popup.open() (kivy)

被刻印的时光 ゝ 提交于 2021-01-29 11:19:51
问题 I'm trying to develop a kivy app for my less-comp-savvy colleagues which wraps a nice GUI around some computations which I developed for a project; currently I have two methods embedded in a class, one (called 'dummy') which keeps the GUI from freezing and from such multithreads the second method (called 'calculate') which actually runs the computation. Within the dummy method I'm hoping to open a popup which displays a 'loading GIF' (indicating that the program is running and not just frozen

How to Call a Function with 'on_press' command inside same class using KIVY button

 ̄綄美尐妖づ 提交于 2021-01-29 11:14:27
问题 I'm trying to call a popup and the have the user input text. After hitting the save button inside my popup it updates a new widget. I have almost everything working but I don't know how to properly call a function inside the same class. I have two functions inside of my 'class Trackers(Screen):' how can I make a button that 'on_press' command will trigger another function? The line of code I need to be fixed is this: okay = Button(text='Save', on_press=self.addit(str(text_input), num), on

Create kivy apk with buildozer ERROR: “Aidl cannot be executed”

自作多情 提交于 2021-01-29 11:09:34
问题 I want to upload my kivy application to Google Play store. For that i Need an .apk file , which has an api Level of 26 or higher. The .apk that I created had an apk Level of 19. So this was my way to set the Level to 26: I installed API 26,27,28 and the newest version of the building tool. In buildozer.spec i set android.api = 26. After that I run "buildozer android release deploy run". And now I get this error: "Check that aidl can be executed Search for Aidl Run 'home/dennis/.buildozer

usage of DragBehavior in Kivy

社会主义新天地 提交于 2021-01-29 11:04:10
问题 I'm new for python and kivy, and struggling with them. I wanted to implement drag and drop function (a function that when a image is dragged to another image and dropped on it, do something.) with kivy. What I want to do are the following three things; know the id of the element that the user has been holding now. know the id of the element that the user is on hover. know the id of the element which was under the pointer when the user has dropped what he had. I thought this would be useful to