KIvy grid height

12 views
Skip to first unread message

Andrei Marin

unread,
Mar 30, 2019, 9:35:36 AM3/30/19
to Kivy users support
hello i want to change the height of the lines so that they are more stuck together, how do i do it

, this is my code:


from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.clock import Clock

class main_page(GridLayout):



def __init__(self, **kwargs):

self.line = 0
self.ballx= 2
self.bally= 2
self.width = 10
self.aaa=10
super(main_page, self).__init__(**kwargs)
self.cols = 1
self.add_widget(Label(text="hello"))
Clock.schedule_once(self.my_callback, 1)

def my_callback(self, dt):
self.clear_widgets()
Clock.schedule_once(self.aparitie, .5)

def aparitie(self, dt):
for x in range(self.aaa):
self.line+=1
if self.line==self.ballx:
self.add_widget(Label(text="."*(self.bally-1)+"X"+"."*(20-self.bally)))
else:
self.add_widget(Label(text="."*20 ))


class MyApp(App):

def build(self):
return main_page()


if __name__ == '__main__':
MyApp().run()

Reply all
Reply to author
Forward
0 new messages