Python Forum
[Kivy] Blank Screen
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Kivy] Blank Screen
#1
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"
Reply
#2
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
Reply
#3
Hello iam getting the same issue kindly help me fix it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [pyglet] Why is screen blank when displaying a gif when setting fullscreen = True ? Huudzz 0 2,275 Oct-25-2019, 06:13 PM
Last Post: Huudzz

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020