kivy

How to change popup color in kivy

こ雲淡風輕ζ 提交于 2021-02-08 06:57:20
问题 In Kivy, Popup appears in grey color, what should be changed to make it red color My popup code: class MyPopup(Popup): def show_popup(self): content = BoxLayout(orientation="vertical") content.add_widget(Label(text="Game Over", font_size=20)) mybutton_cancel = Button(text="Cancel", size_hint_y=None) content.add_widget(mybutton_cancel) mypopup = Popup(content = content, title = "oops", auto_dismiss = False, size_hint = (.5, .5)) mybutton_cancel.bind(on_release=mypopup.dismiss) mypopup.open() I

Correct way to implement loading popup in kivy app

两盒软妹~` 提交于 2021-02-08 06:51:57
问题 I have a kivy app, in which when a button is pressed, it starts communicating with the server and based on information obtained, it creates and fills the screen with widgets. Some actions are almost instant, some take considerable time in seconds. I want to implement a loading popup that is shown while the screen loads. I would also like to do it so that when loading takes less time than some configured time period, lets call it MIN_TIME, the popup does not show at all. Moreover, if the

Correct way to implement loading popup in kivy app

偶尔善良 提交于 2021-02-08 06:50:39
问题 I have a kivy app, in which when a button is pressed, it starts communicating with the server and based on information obtained, it creates and fills the screen with widgets. Some actions are almost instant, some take considerable time in seconds. I want to implement a loading popup that is shown while the screen loads. I would also like to do it so that when loading takes less time than some configured time period, lets call it MIN_TIME, the popup does not show at all. Moreover, if the

Correct way to implement loading popup in kivy app

假装没事ソ 提交于 2021-02-08 06:50:13
问题 I have a kivy app, in which when a button is pressed, it starts communicating with the server and based on information obtained, it creates and fills the screen with widgets. Some actions are almost instant, some take considerable time in seconds. I want to implement a loading popup that is shown while the screen loads. I would also like to do it so that when loading takes less time than some configured time period, lets call it MIN_TIME, the popup does not show at all. Moreover, if the

Kivy Get Position of Widget in Scatter while moving it

久未见 提交于 2021-02-08 05:17:05
问题 I searched a lot for it bit i didn't find a solution. I would like to grab a widget in a kivy scatter and get the position of it each time i move it. So it could like so: def onmove_in_scatter(args): x = args[0] y = args[1] print("You are currently here: "+str(x)+":"+str(y)) It's important that the function is called WHILE i move the widget. 回答1: When I want to do something like this I override the on_touch_move. Here is a full* working example. (just put a cat.png somewhere...) import kivy

Kivy Get Position of Widget in Scatter while moving it

跟風遠走 提交于 2021-02-08 05:15:39
问题 I searched a lot for it bit i didn't find a solution. I would like to grab a widget in a kivy scatter and get the position of it each time i move it. So it could like so: def onmove_in_scatter(args): x = args[0] y = args[1] print("You are currently here: "+str(x)+":"+str(y)) It's important that the function is called WHILE i move the widget. 回答1: When I want to do something like this I override the on_touch_move. Here is a full* working example. (just put a cat.png somewhere...) import kivy

How I can use startActivity method from service in python kivy/jnius?

白昼怎懂夜的黑 提交于 2021-02-08 04:29:34
问题 I want to start an activity from a service in my android application (python 2.7 & kivy). I use startActivity method for it but it's not work. When I run the app and type "buildozer android logcat" , I see this: File "jnius_export_class.pxi", line 900, in jnius.jnius.JavaMultipleMethod.__ call__ (jnius/jnius.c:24581) JavaException: No methods matching your arguments Part of my service code: from jnius import autoclass, cast PythonService = autoclass("org.renpy.android.PythonService") activity

In kivy, How can I control the height of the VKeyboard used by TextInput

喜欢而已 提交于 2021-02-07 20:16:26
问题 I have a Screen where I want to ask a question, so in the kv language, I have Screen: name: 'keyb' BoxLayout: orientation: 'vertical' Label: id: rnl size_hint_y: .1 text: '' TextInput: id: tinput hint_text: '.mid' size_hint: (.8, .1) pos_hint: {'x': .1} multiline: False on_focus: root.focusCallback(args[1]) Widget: size_hint_y: .7 When I want to ask the question, I select the screen and set the focus to the TextInput self.tinput.text = "" self.screens.current = 'keyb' Clock.schedule_once(self

In kivy, How can I control the height of the VKeyboard used by TextInput

左心房为你撑大大i 提交于 2021-02-07 20:14:03
问题 I have a Screen where I want to ask a question, so in the kv language, I have Screen: name: 'keyb' BoxLayout: orientation: 'vertical' Label: id: rnl size_hint_y: .1 text: '' TextInput: id: tinput hint_text: '.mid' size_hint: (.8, .1) pos_hint: {'x': .1} multiline: False on_focus: root.focusCallback(args[1]) Widget: size_hint_y: .7 When I want to ask the question, I select the screen and set the focus to the TextInput self.tinput.text = "" self.screens.current = 'keyb' Clock.schedule_once(self

Why can't this Python multiprocessing process be terminated from Kivy?

房东的猫 提交于 2021-02-07 13:22:46
问题 I'm trying to run a django development server from within a Kivy application. This did work out quite well so far. Now i want to allow the user to continue working with the program while the server is running. My idea was to create a multiprocessing.Process for the httpd.serve_forever() to avoid a complete lock of the main program. Did work well. This is the code in my internal_django module: import multiprocessing import os import time from wsgiref.simple_server import make_server def django