kivy

KivyMD MDTabs can't handle

回眸只為那壹抹淺笑 提交于 2021-01-29 06:50:52
问题 I'm just started to work with KivyMD. I was working on MDTabs system. I'm trying to switch tab after release button. If I try get_tab_list() func. under MDTabs(id:tabs), I get this error: AttributeError: 'MDTabs' object has no attribute 'get_tab_list' I can't figure it out. Please help me. from kivy.uix.floatlayout import FloatLayout from kivymd.app import MDApp from kivymd.uix.tab import MDTabsBase KV = ''' BoxLayout: orientation: "vertical" MDToolbar: title: "Example Tabs" MDTabs: id: tabs

Retrieve Data from Kivy Recycleview

↘锁芯ラ 提交于 2021-01-29 06:21:05
问题 I am able to make a recycle view layout of TextInput boxes. Now, further, I would like to give text input in these boxes and gather these inputs in the form of list or dict. I have tried, self.ids.idname.data to append in an empty list but it didn't work. 回答1: Following an example showing how to extract TextInput entries under a RecycleView and put that into a list: from kivy.app import App from kivy.lang import Builder from kivy.uix.boxlayout import BoxLayout from kivy.properties import

Kivy: Dismiss One Popup From Another Popup

这一生的挚爱 提交于 2021-01-29 06:09:24
问题 I use kivy.factory.Factory to open the popups, but it's not working when I want to close them. Code: from kivy.app import App from kivy.lang import Builder x = Builder.load_string(""" #:import F kivy.factory.Factory #:import Window kivy.core.window.Window Screen: Button: text: 'Press to Open First Popup' on_press: F.FirstPopup().open() <FirstPopup@Popup>: title: 'First Popup' size_hint: None, None width: Window.width / 1.4 height: Window.width / 1.4 Button: text: 'Press to Open Second Popup'

Kivy: Builder.load_file('*.kv') throws a FileNotFoundError when packaging app for Windows

半世苍凉 提交于 2021-01-29 05:57:54
问题 I am attempting to package my app for windows but I keep getting this error when running the .exe file generated. The file does exist in the project directory and it works fine when running main.py directly. In my main.py I called Builder.load_file('home_screen.kv'), which is where it seems to be throwing the error. Traceback (most recent call last): File "main.py", line 46, in <module> File "site-packages\kivy\app.py", line 800, in run File "main.py", line 10, in build File "main.py", line

Kivy - How do I restrict the ImageButton click space to only on the image itself? (and not the blank “occupied” space)?

戏子无情 提交于 2021-01-29 05:19:14
问题 I have four ImageButtons in a row, all separated by (what seems to be) blank space. This blank space also however acts as a button (up to the halfway point between the two Buttons' entire section allocated for the Image) ''' FloatLayout: canvas: Color: rgb: utils.get_color_from_hex("#0a5a97") Rectangle: size: self.size pos: self.pos pos_hint: {"top":0.125,"right":1} size_hint: 1,.125 ImageButton: source: "Icons5/040-user.png" pos_hint: {"top":0.95,"right":1} size_hint: .3,.7 on_release: print

How to dynamically resize label in kivy without size attribute

时光毁灭记忆、已成空白 提交于 2021-01-29 05:04:58
问题 So, I get that you can usually just use self(=)(:)texture_size (py,kv) but all of my widgets are either based on screen(root only) or size_hint. I am doing this on purpose for a 'cross-platform' GUI. I open it on my android and the text is either too small or running off the screen i dont want to wrap it only resize. What properties of the Label can I set so that it auto adjusts the font to fill the parent height and width (which is not explicitly defined)? The text on the following Labels is

Kivy, StackLayout, object order

老子叫甜甜 提交于 2021-01-29 05:01:18
问题 I have a screen with a StackLayout. The first row of the stack includes a textinput and a "+" button which is meant to add another identical row below the actual one in a loop (i.e. another textinput with another "add" button). Then there is a "Save" button, which is supposed to be always at the end of the stack. The dictionary is supposed to later grab the input from the text field, when pressing the save button, but this should not be relevant to my problem. There are two problems with my

Using Kivy, dynamically add items when a button is pressed

旧时模样 提交于 2021-01-29 05:01:16
问题 I wrote the following code. I want to be able to dynamically add as many items as I want when I press the Add Item button. #-*- coding: utf-8 -*- from kivy.config import Config Config.set('graphics', 'width', 300) Config.set('graphics', 'height', 300) from kivy.lang import Builder Builder.load_string(""" <AddItemWidget>: BoxLayout: size: root.size orientation: 'vertical' RecycleView: size_hint: 1.0,1.0 BoxLayout: orientation: 'vertical' Button: id: button1 text: "Button1" Button: id:

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: Unable to get a Text provider, abort

瘦欲@ 提交于 2021-01-28 18:40:48
问题 So i try this code: from kivy.app import App from kivy.uix.label import Label class FirstKivy(App): def build(self): return Label(text="Hello Kivy!") FirstKivy().run() And got this error : [INFO ] [Logger ] Record log in C:\Users\raviv.kivy\logs\kivy_19-04-17_45.txt [INFO ] [Kivy ] v1.10.1 [INFO ] [Python ] v3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] [INFO ] [Factory ] 194 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, img_gif (img_sdl2,