kivy

Kivy TextInput with DropDown widget does not allow scrolling

我与影子孤独终老i 提交于 2021-02-11 15:14:31
问题 I have several textinputs inside a ScrollView. When a 'normal' TextInput is on focus, I can easily scroll the view without losing the focus on the textinput. However, if the textinput opens a MeasureDropDown (custom DropDown) widget, scrolling is not possible anymore. The behavior is actually sligthly different on Windows and Android: On Windows, I can scroll the view only if the mouse cursor is not above the TextInput; On Android, there is no way to scroll the view as long as the textInput

Kivy - Drop-down List - How to get current text from selected button?

十年热恋 提交于 2021-02-11 14:48:17
问题 In the following code, there is a button that when pressed shows a drop-down list with 9 Values. Once I select one of these options, I would like to print on Python what is the value that I selected. For example, if I select "Value 4", in the moment that I select "Value 4" this value has to be printed in my code. I found some similar question about this, and I provide the link below, although none of them solved my problem. Python, Kivy. Get text from dynamically created buttons with a

Main KV File cant be found in Pyinstaller exe

我与影子孤独终老i 提交于 2021-02-11 14:48:05
问题 I'm at my wits end here... So I have a kivy app that runs fine from the interpreter and fine when built as a directory. But it doesn't seem to matter how I build it, the resulting exe always fails to find my main.kv file. My file structure is that I basically have images and a bunch of screens. main.py main.kv resources/image 1 /image 2 /kv_files/screen1 /screen2 I have been over all the similar question on SO including this one, and this one and this one. I think I have tried all of the

Python Kivy: Update Label

六眼飞鱼酱① 提交于 2021-02-11 14:31:08
问题 i am new in the Kivy Topic and i have got a simple question (i think). With the function "zufall" i create a random number. This number should update every 2 seconds in the label. But when i am running the code, the error "Label.text accept only str" occurs. But from my opinion i made the "random_number" to a string. Or is there another problem, with my thinking? from kivy.app import App from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.uix.textinput import

How do I set the screen background to image in kivy

与世无争的帅哥 提交于 2021-02-11 14:27:04
问题 How do I change the background to image in this code am not using any .Kv file. I want to set the screen background to an image but am only seeing the ones with .kv file import kivy from kivy.app import App from kivy.uix.floatlayout import Floatlayout from kivy.uix.widget import Widget from kivy.uix.button import Button from kivy.label import Label class LandingScreen(FloatLayout): def __init__(self, **kwargs): super(LandingScreen, self).__init__(**kwargs) self.score=0 # put whatever pos_hint

Failed to install the module kivy in windows with pip

泪湿孤枕 提交于 2021-02-11 14:14:54
问题 I'm in a AMD 64 bits Windows 10 computer in french with python 3.8.5 First I try to install kivy with the help of the official website (https://kivy.org/doc/stable/installation/installation-windows.html) but it failed while «Building wheel for kivy (setup.py)» The complet error has a length of 531 lines so I show only the more important part ERROR: Command errored out with exit status 3221225477: command: 'c:\users\%myusername%\appdata\local\programs\python\python38\python.exe' -u -c 'import

How to use input to TextInput in kivy to get different output

守給你的承諾、 提交于 2021-02-11 13:54:10
问题 I wrote the following code. #-*- coding: utf-8 -*- from kivy.config import Config from kivy.uix.button import Button from functools import partial Config.set('graphics', 'width', 300) Config.set('graphics', 'height', 300) from kivy.lang import Builder Builder.load_string(""" <KeybindTestWidget>: BoxLayout: size: root.size orientation: 'vertical' TextInput: id: textinput1 size_hint_y: 0.45 text: "" on_focus: root.set_activeTextInput("textinput1") BoxLayout: size_hint_y: 0.1 TextInput: id:

Kivy - automatically start a method from popup

别来无恙 提交于 2021-02-11 13:53:11
问题 PROBLEM I am using Python3 and Kivy2. Regardless I would like a popup to automatically start a time consuming method in the background DESCRIPTION In the script call for the popup when a condition is met. if self.header == "loadbag": messageTitle = "machine status" messageLabel = "work in progress" self.popup(messageTitle, messageLabel) The popup method structure is: def popup(self, boxTitle, boxLabel): # popup for showing the activity self.MessageButtonCancel = "ANNULLA" self.MessageBoxTitle

Label keeps running off edge of ScrollView screen x axis Kivy

我怕爱的太早我们不能终老 提交于 2021-02-11 13:50:10
问题 I'm creating a chat screen, adding a Label to my GridLayout everytime the send button is pressed. However, my Labels run off the side of the screen when the text becomes too long, I would like them to wrap round and the text to go onto a new line but this isn't happening and I'm not sure why. <ChatPage>: name: "chat_page" layout_content: layout_content NavigationLayout: id: nav_layout MDNavigationDrawer: NavigationDrawerIconButton: text: "Test" on_release: app.root.current = "login"

Cant display speedometer on MainWindow (kivy)

亡梦爱人 提交于 2021-02-11 13:35:51
问题 I am trying to display the speedometer in my MainWindow screen. Right now when i run the code, the speedometer works but it is not displayed on the MainWindow screen which i want rather it is just appearing on a normal screen. It is possible to combine class Gauge(Widget): and class MainWindow(Screen): together so that the speedometer will actually be displayed on the MainWindow? .py file import kivy kivy.require('1.6.0') from kivy.app import App from kivy.clock import Clock from kivy