from kivy.app import App
from kivy.lang import Builder
from kivy.uix.layout import Layout
class Foo(Layout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.bind(pos=self.update)
self.bind(size=self.update)
self.update()
def update(self, *args):
print(self.size)
self.canvas.clear()
with self.canvas:
pass
class MyApp(App):
def build(self):
return Foo()
MyApp().run()