Skip to content

Instantly share code, notes, and snippets.

@Kovak
Created August 1, 2015 02:11
Show Gist options
  • Save Kovak/aac7ac890c6d5737f824 to your computer and use it in GitHub Desktop.
Save Kovak/aac7ac890c6d5737f824 to your computer and use it in GitHub Desktop.
__author__ = 'Alan'
__version__ = '0.1'
import kivy
kivy.require("1.0.0")
from kivy.app import Builder
from kivy.app import App
from kivy.core.window import Window
from kivy.clock import Clock
mybutstr = """
#:import win kivy.core.window
Button:
size_hint: None,None
size: '65dp','35dp'
center_y: win.Window.height*0.5
on_height: self.center_y = win.Window.height*0.5
center_x: win.Window.width*0.5
text: 'test'
"""
class MyApp(App):
def build(self, **kwargs):
self.mybut = Builder.load_string(mybutstr)
Clock.schedule_interval(self.resizeBut,0.1)
return self.mybut
def resizeBut(self, *args):
self.mybut.height = self.mybut.height+10
MyApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment