kivy-language

Scatter Covers whole display kivy

三世轮回 提交于 2019-12-04 16:10:37
im writing a paint app in Kivy (Python) and i orientated myself at the Kivy Paint Tutorial. But when I wanted to add a Scroll funktion (so you can move your painted things to the top, left, right...) i came to an problem. I added a Scatter, so everything that is drawn is inside the scatter and it is posible to move it all together. Now im trying to add a menu but it isnt possible to press the button, because it is covered by the scatter. I tried to put both in a Float layout, but it didnt worked. My code: from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen from

Kivy RecycleView as an alternative to ListView? How does it work?

末鹿安然 提交于 2019-12-04 09:50:31
问题 I should preface that I'm still a newbie to Kivy. I tried looking for similar questions, but they were either outdated or unclear. I was looking for something to display a list of elements among which a used could select one to interact with other widgets (buttons and so on). I stumbled upon the documentation page on ListView, but it clearly states that ListView is deprecated and RecycleView must be used instead. Now the problem is that the documentation doesn't seem very clear (at least to

How to access some widget attribute from another widget in Kivy?

余生颓废 提交于 2019-12-04 06:22:16
问题 Ok let's say I want that label in some widget to use text from label inside another widget: <SubWidget@RelativeLayout>: Label: text: str(root.parent.ids.first.text) <RootWidget>: Label: id: first center_x: 100 text: "text" SubWidget: id: second center_x: 200 This works but doesn't seem to be nice solution. If I'll place first inside another widget I'll need to change reference to that it everywhere in the code (that can lead to errors). My first idea was at least to store reference to first

Python kivy | Arabic text on Label text

孤街醉人 提交于 2019-12-04 05:06:59
问题 My problem when i try type arabic text My code is : import kivy from kivy.app import App from kivy.uix.textinput import TextInput class TestApp(App): def build(self): return TextInput(text='مرحبا بكم ') myapp=TestApp() myapp.run() when i execute Textinput text is a some of Square 回答1: You'll have to give the label a font that support Arabic #option1 -- on each TextInput TextInput: font_name: "path/to/a/font/that/support/arabic.ttf" #option2 override for all TextInputs <TextInput>: font_name:

Python/Kivy : Call function from one class to another class and show widget in Python

烈酒焚心 提交于 2019-12-03 14:15:19
问题 I am using Python-2.7 and Kivy. When I run test.py then a show button shows. When I click on the show button then a label and value shows. I am fetching it from the database but now I defined it as a static array. When I click on Item1 label then call def open_form and pass id 11 after calling EditPopup(self) with id and show a popup with value. After that I change itemCode and click on the ok button then it updates data in the database. After that I call Invoice().abc() then it prints the

Problem with Kivy when trying to scrolldown vertical ScrollView with an horizontal ScrollView inside

橙三吉。 提交于 2019-12-02 16:19:31
问题 Ok, so I'm building something with Kivy(1.11.1) and summarizing I have a ScrollView that scrolls vertically and inside it there are some others ScrollViews but these ones only scroll horizontally, the problem is that whenever I scroll the outer ScrollView down and the mouse position gets into the inner Horizontal ScrollViews the outer Scrollview stops scrolling down, it looks like once the mouse position collides with the horizontal scrollview the scroll behavior stops being sent to the outer

Problem with Kivy when trying to scrolldown vertical ScrollView with an horizontal ScrollView inside

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 10:07:25
Ok, so I'm building something with Kivy(1.11.1) and summarizing I have a ScrollView that scrolls vertically and inside it there are some others ScrollViews but these ones only scroll horizontally, the problem is that whenever I scroll the outer ScrollView down and the mouse position gets into the inner Horizontal ScrollViews the outer Scrollview stops scrolling down, it looks like once the mouse position collides with the horizontal scrollview the scroll behavior stops being sent to the outer ScrollView (vertical) so it stops scrolling down. What I want is something like the Netflix page, in

How to access some widget attribute from another widget in Kivy?

一笑奈何 提交于 2019-12-02 08:51:44
Ok let's say I want that label in some widget to use text from label inside another widget: <SubWidget@RelativeLayout>: Label: text: str(root.parent.ids.first.text) <RootWidget>: Label: id: first center_x: 100 text: "text" SubWidget: id: second center_x: 200 This works but doesn't seem to be nice solution. If I'll place first inside another widget I'll need to change reference to that it everywhere in the code (that can lead to errors). My first idea was at least to store reference to first at root level and reference to it: <SubWidget@RelativeLayout>: Label: text: str(root.parent.l.text)

How to duplicate blocks of widgets in kv file (lowercase-only rule)

此生再无相见时 提交于 2019-12-02 08:27:43
I try to understand how kivy .kv files work, so I created a small application with a horizontial BoxLayout which contains three GridLayouts, as shown: my_widget: <my_widget@BoxLayout>: orientation: "horizontal" GridLayout: rows: 3 ToggleButton: Image: Label: GridLayout: rows: 3 ToggleButton: Image: Label: GridLayout: rows: 3 ToggleButton: Image: Label: No problem there, but since there are same blocks of widgets (GridLayouts) could they be duplicated? I tried something like: https://kivy.org/docs/api-kivy.lang.html my_widget: [my_widget2@GridLayout]: rows: 3 ToggleButton: Image: Label: <my

Highlight a Kivy ToggleButton with mouse hovering

大城市里の小女人 提交于 2019-12-02 02:24:00
问题 I am currently coding a GUI with Kivy. I need to modify a ToggleButton behaviour so that it is highlighted when hovered by the mouse. Here is my code so far: class FilterToggle(ToggleButton): def __init__(self, **kwargs): Window.bind(mouse_pos=self.on_mouse_pos) super(FilterToggle, self).__init__(**kwargs) def on_mouse_pos(self, *args): pos = args[1] if self.collide_point(*pos): print("I am on the good path!) Here is my .kv file: <FilterToggle>: text_size: self.width - 20, None valign: