kivy

How to position BoxLayout to top of screen

人走茶凉 提交于 2020-01-25 00:38:25
问题 I have a ActionBar that is nested inside a BoxLayout widget. I'd like the ActionBar to appear at the very top of the screen. Currently, I'm only able to get it to appear at the very bottom. Here is a screenshot: Here is my main.py: from kivy.app import App from kivy.uix.boxlayout import BoxLayout class ShowActionBar(BoxLayout): pass class MyTestApp(App): pass if __name__ == "__main__": MyTestApp().run() And here is my .kv file: ShowActionBar: <ShowActionBar>: orientation: "vertical" BoxLayout

Buildozer fails, I think I need the prerequisite 32 bit libraries, but Fedora uses yum, not apt-get

久未见 提交于 2020-01-24 16:20:05
问题 I'm trying to compile a fairly simple kivy application into an android app. The kivy application is written in python2.7. It compiles the application, but then fails. Here's the log: http://pastebin.com/Q60ErXxf From what I've seen, I'm missing some 32-bit libraries that kivy and buildozer require. Here's the page with the apt-get instructions: http://python-for-android.readthedocs.org/en/latest/prerequisites/ However, Fedora uses yum, and I've tried yum install for these packages, but to no

Installing Kivy-designer

隐身守侯 提交于 2020-01-24 12:28:47
问题 I was wondering if there's an easy way to install kivy-designer. I am on Mac OS X and followed all the steps to install Kivy itself but when i tried to open application, it wasn't responding. However, when i wrote "kivy" in console, it launched the Python shell and I had no errors after executing command "import kivy": [INFO ] [Logger ] Record log in /Applications/Kivy.app/Contents/Resources/.kivy/logs/kivy_16-03-31_1.txt [INFO ] [Kivy ] v1.9.1 [INFO ] [Python ] v3.5.0 (default, Dec 12 2015,

How to get an windows executable from my kivy app (Pyinstaller)?

夙愿已清 提交于 2020-01-24 10:14:36
问题 I've done a kivy app and I packaged to an .apk with buildozer. The fact is that now I want to package in a .exe for windows with Pyinstaller but I have realised that this two programs (buildozer and Pyinstaller), don't work in the same way. I've been looking for a good tutorial that could help me to get the file, but all the tutorials I have seen are too simple and don't explain for example how to import external files of the main.py (e.g. images) and how to import external modules (In

How to get an windows executable from my kivy app (Pyinstaller)?

廉价感情. 提交于 2020-01-24 10:13:29
问题 I've done a kivy app and I packaged to an .apk with buildozer. The fact is that now I want to package in a .exe for windows with Pyinstaller but I have realised that this two programs (buildozer and Pyinstaller), don't work in the same way. I've been looking for a good tutorial that could help me to get the file, but all the tutorials I have seen are too simple and don't explain for example how to import external files of the main.py (e.g. images) and how to import external modules (In

Remove or replace the kivy splash screen on startup

非 Y 不嫁゛ 提交于 2020-01-24 04:10:50
问题 When I launch my app (based on kivy) on my phone, there is 1 ~ 2 seconds showing the splash screen, says 'Loading...', before the main window becomes visible. How can I remove this in the code(main.py) or somewhere in the config(I found no config related to this(kivy.config)? Does this seems to related to OpenGL or pygame? 回答1: This screen is part of the python-for-android process, not something you can directly modify in your kivy app. As you commented, you can change what image is displayed

Use custom widgets kivy

旧街凉风 提交于 2020-01-23 19:43:44
问题 I'm trying to build a kivy app using some custom widgets. However whenever I try to use them they never work with my layout. Using a normal button: import kivy kivy.require('1.8.0') from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import ListProperty class RootWidget(Widget):pass class myApp(App): def build(self): global rw rw = RootWidget() return rw if __name__ == '__main__': myApp().run() #:kivy 1.8.0 <RootWidget>: BoxLayout: size: root.size orientation:

How to run a Method on the exit of a kivy app

微笑、不失礼 提交于 2020-01-23 11:08:47
问题 I would like to run a Method when the user tries to exit the app , kind of like a "are you sure you want to exit" or "Do you want to save the file" type of message whenever the user tries to exit by clicking the Exit button on top of the window Some thing like on_quit: app.root.saveSession() 回答1: If you want your application to simply run things after the GUI has closed, the easiest and smallest approach would be to place any exit code after TestApp().run() . run() creates a endless loop

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

荒凉一梦 提交于 2020-01-22 03:08:05
问题 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

Kivy window set_title changes back to main file name

不羁岁月 提交于 2020-01-22 03:02:16
问题 When I set the window title, the title is set back to it's corresponding file name. class myniceApp(App): global Window def build(self): Window.clearcolor = (.95,.95,.95,1) Window.size = (1024, 768) Window.set_title('mykivyapp') Builder.load_string(style) homewin = MyniceappHome() homewin.initapp() return homewin myniceApp().run() In the above example, the title 'mykivyapp' is shown initially but set back to the filename after homewin.initapp() How should set_title() be used? 回答1: Window