kivy-language

Python+kivy+SQLite: How to set label initial value and how to update label text?

江枫思渺然 提交于 2019-12-08 13:22:21
问题 everyone, I want to use kivy+Python to display items from a db file. To this purpose I have asked a question before: Python+kivy+SQLite: How to use them together The App in the link contains one screen. It works very well. Today I have changed the App to two screens. The first screen has no special requirement but to lead the App to the second screen . In the second screen there is a label and a button . By clicking the button I want to have the label text changed. The label text refers to

Kivy - My ScrollView doesn't scroll

坚强是说给别人听的谎言 提交于 2019-12-08 13:20:32
问题 I'm having problems in my Python application with Kivy library. In particular I'm trying to create a scrollable list of elements in a TabbedPanelItem, but I don't know why my list doesn't scroll. Here is my kv file: #:import sm kivy.uix.screenmanager ScreenManagement: transition: sm.FadeTransition() SecondScreen: <SecondScreen>: tabba: tabba name: 'second' FloatLayout: background_color: (255, 255, 255, 1.0) BoxLayout: orientation: 'vertical' size_hint: 1, 0.10 pos_hint: {'top': 1.0} canvas:

Im New on kivy Python classes

偶尔善良 提交于 2019-12-08 12:07:21
问题 Im new on kivy I trying to do file.kv including AddLocationForm: <AddLocationForm@BoxLayout>: orientation:'vertical' Button: on_press: Test() <Test@BoxLayout>: Label: text:"button was clicked" I want that when i click on button The function on other class execute 回答1: In Kivy, when you define a widget like this: <SomeWidget>: You are defining a root widget rule, this widget can only affect children widget inside it. For example: <SomeWidget>: BoxLayout: Button: text: 'Test Two' Button: text:

Kivy - Create style buttons for reStructuredText

人盡茶涼 提交于 2019-12-08 09:39:54
问题 I would like to create buttons for the reStructuredText widget in Kivy. The buttons would do basic things like bold, underline, or make a heading so the user doesn't have to manually type in the markup. For example, the user could select some text then click the 'bold' button and the text would then be surrounded by [b]...[/b]. I would love to show code of what I've tried but I honestly don't even know where to begin. (Or please let me know if there is a better way to implement basic text

Python - Kivy: AttributeError: 'super' object has no attribute '__getattr__' when trying to get self.ids

夙愿已清 提交于 2019-12-07 04:29:24
问题 I wrote a code for a kind of android lock thing, whenever I try to get an specific ClickableImage using the id it raises the following error: AttributeError: 'super' object has no attribute '__getattr__' I've spent hours trying to look for a solution for this problem, I looked other people with the same issue, and people told them to change the site of the builder, because it needed to be called first to get the ids attribute or something like that, but everytime I move the builder, it raises

get value of selected checkbox in kivy

爷,独闯天下 提交于 2019-12-06 16:41:06
test.py import sqlite3 as lite from kivy.uix.screenmanager import Screen from kivy.app import App from kivy.lang import Builder from kivy.core.window import Window Window.size = (600, 325) class UserGroup(Screen): def insert_data(self, arg1,arg2): print(arg1) print(arg2) class FactUserGroup(App): def build(self): self.root = Builder.load_file('test.kv') return self.root if __name__ == '__main__': FactUserGroup().run() test.kv <CustomLabel@Label>: text_size: self.size valign: "middle" padding_x: 5 <SingleLineTextInput@TextInput>: multiline: False <GreenButton@Button>: background_color: 1, 1, 1,

get values from a different screen (kivy)

不羁的心 提交于 2019-12-06 15:07:38
问题 I´m trying to achieve the following: capture the text from from Label: id: fb in screen FolderB and copy/add to Label: id: fa in screen FolderA by pressing the Button "get the txt from Folder B". Please find the codes below: Thanks in advance, file main.py from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen from kivy.lang import Builder Builder.load_file('foldera.kv') Builder.load_file('folderb.kv') class MainScreen(ScreenManager): pass class FolderA(Screen):

how to run a file from another python file

吃可爱长大的小学妹 提交于 2019-12-05 08:04:46
问题 a.py from kivy.app import App from kivy.uix.dropdown import DropDown from kivy.lang import Builder class CustDrop(DropDown): def __init__(self, **kwargs): super(CustDrop, self).__init__( **kwargs) self.select('') kv_str = Builder.load_string(''' BoxLayout: orientation: 'vertical' BoxLayout: canvas.before: Rectangle: pos: self.pos size: self.size Color: rgb: (1,1,1) size_hint_y:1 Button: id: btn text: 'test' on_release: dropdown.open(self) #size_hint_y: None #height: '48dp' CustDrop: id:

get values from a different screen (kivy)

筅森魡賤 提交于 2019-12-04 21:12:55
I´m trying to achieve the following: capture the text from from Label: id: fb in screen FolderB and copy/add to Label: id: fa in screen FolderA by pressing the Button "get the txt from Folder B". Please find the codes below: Thanks in advance, file main.py from kivy.app import App from kivy.uix.screenmanager import ScreenManager, Screen from kivy.lang import Builder Builder.load_file('foldera.kv') Builder.load_file('folderb.kv') class MainScreen(ScreenManager): pass class FolderA(Screen): pass class FolderB(Screen): pass class FTest(App): def build(self): return MainScreen() if __name__ == '_

Python/Kivy : Selection Row in RecycleView using `Up` and `Down` key

只愿长相守 提交于 2019-12-04 18:11:25
I am using python-2.7 and kivy. When i run test.py and click on Test menu then screen shows like attached image. 1. How to highlight first row by default on screen load? When press up and down key of keyboard then it should be select row according up and down key . 2. When i click on any row then it opens in modify case.How to open selected row in modify case using ctrl+e instead of click? test.py import kivy kivy.require('1.9.0') from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.properties import BooleanProperty, ListProperty, ObjectProperty,NumericProperty from kivy