kivy-language

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

Kivy canvas.clear() not clearing the canvas

我的梦境 提交于 2021-01-29 10:13:46
问题 I have followed the widget tutorial for Kivy, but I cannot get the canvas to clear after painting (from their 'a simple paint app' tutorial), unless I resize the window after pressing the clear button. Please help. I am using kivy v1.10.1 and python v3.7.0. on windows 10 64-bit OS. Further, a widget in scatter mode leaves a trace when you drag to a new position, this also clears when resizing the window. See code below: from random import random from kivy.app import App from kivy.uix.widget

Can't get kivy progress bar to update

一笑奈何 提交于 2021-01-29 08:36:29
问题 I've been building an app and I've been struggling to get the progress bar to update after each function is called. In the code below, my intent was to call a function then once that function finished running, I would update the self.load attribute with a new value. After assigning the self.load with a new value I want to pass it onto the progress bar in kivy so that its value would increase and it would be displayed on screen. import SEOProgram import time import os import kivy from kivy.app

Kivy touch and keyboard events passing through to desktop

安稳与你 提交于 2021-01-28 20:21:46
问题 I am using the Kivy framework to develop a UI application in Python 3. The Kivy application is fullscreen. Whenever I perform a touch event or type with my physical keyboard, the underlying desktop environment will receive the touch and keyboard events as well as my Kivy application. For example, if I open a text file on my desktop and then run my Kivy application, I am able to blindly type text into the text file while the Kivy application is in the foreground (fullscreen). The Kivy

Kivy Error: No Screen with Name

岁酱吖の 提交于 2021-01-28 08:52:27
问题 I set up a Screen in a Kivy ScreenManager (myScreen is just a class that inherits Screen) class firstScreen(myScreen): def __init__(self,**kwargs): super(firstScreen, self).__init__(**kwargs) self.name = "first" self.add_widget(Button(on_release = switchScreens("second"))) I also set up a second screen: class secondScreen(myScreen): def __init__(self,**kwargs): super(secondScreen, self).__init__(**kwargs) self.name = "second" I then set up my ScreenManager: sm = ScreenManager() sm.add_widget

Browse an image file and display it in a kivy window

老子叫甜甜 提交于 2021-01-27 19:32:59
问题 I am a beginner in Kivy and trying to browse an image file using kivy fileChooser and then displaying it on the window. Bellow you find my code but it wouldn't do the task. It just displays '?PNG' on the console. Please, check this out with me ! import kivy from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from kivy.uix.image import Image import os Builder.load_string(""" <MyWidget>: id: my_widget Button text: "open" on_release: my_widget.open

Kivy-how can i make my canvas height smaller than the parent height

我怕爱的太早我们不能终老 提交于 2021-01-27 12:28:13
问题 I have a stacklayout with a canvas and an image. my image has a size_hint of .1 and I want my canvas to have the same height as my image. .kv file: StackLayout: orientation: 'lr-tb' canvas: Color: rgba: 1,1,1,1 Rectangle: pos: self.pos size: self.size Image: size_hint_y: .1 source: 'Images\login\cptbanner.jpg' allow_stretch: True keep_ratio: True what can I do to get the desired effect? 回答1: A Kivy canvas is not a widget or the space in which you paint. It is only a set of instructions. You

AttributeError: 'super' object has no attribute '__getattr__' Error when using BoxLayout with several kv-files in Kivy

这一生的挚爱 提交于 2021-01-27 11:33:30
问题 As I am very well aware, this question has been asked several times already. But after trying the following solutions: Python - Kivy: AttributeError: 'super' object has no attribute '__getattr__' when trying to get self.ids Python/Kivy AttributeError: 'super' object has no attribute '__getattr__' How can i access object properties of another class in kivy without getting AttributeError: 'super' object has no attribute '__getattr__' AttributeError: 'super' object has no attribute '__getattr__'

AttributeError: 'super' object has no attribute '__getattr__' Error when using BoxLayout with several kv-files in Kivy

泄露秘密 提交于 2021-01-27 11:32:28
问题 As I am very well aware, this question has been asked several times already. But after trying the following solutions: Python - Kivy: AttributeError: 'super' object has no attribute '__getattr__' when trying to get self.ids Python/Kivy AttributeError: 'super' object has no attribute '__getattr__' How can i access object properties of another class in kivy without getting AttributeError: 'super' object has no attribute '__getattr__' AttributeError: 'super' object has no attribute '__getattr__'

AttributeError: 'super' object has no attribute '__getattr__' Error when using BoxLayout with several kv-files in Kivy

不羁的心 提交于 2021-01-27 11:32:16
问题 As I am very well aware, this question has been asked several times already. But after trying the following solutions: Python - Kivy: AttributeError: 'super' object has no attribute '__getattr__' when trying to get self.ids Python/Kivy AttributeError: 'super' object has no attribute '__getattr__' How can i access object properties of another class in kivy without getting AttributeError: 'super' object has no attribute '__getattr__' AttributeError: 'super' object has no attribute '__getattr__'