Python Forum

Full Version: Blank Screen
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
No error message, but I get a plain black window when I run this code:

practice1.py
import kivy
kivy.require("1.10.1")

from kivy.app import App
from kivy.uix.gridlayout import GridLayout

class GridLayoutApp(App):

    def build(self):
        return GridLayout()

glApp = GridLayoutApp()
glApp.run()
customwidget.kv
<GridLayout>:
    cols: 2
    rows: 2
    spacing: 10
    padding: 10

    Button:
        text: "1st"
        size_hint_x: None
        width: 200
    Button:
        text: "2nd"
    Button:
        text: "3rd"
        size_hint_x: None
        width: 200
    Button:
        text: "4th"
I didn't run your code, but I am concerned about naming your app and widgets GridLayout - same as the Kivy grid object.
Another thing is naming of Kivy resource file (.kv) and .py.
Try to rename GridLayoutApp(App) class to customwidgetApp. Example here:
https://kivy.org/doc/stable/examples/gen...v__py.html
Hello iam getting the same issue kindly help me fix it.