This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kivy | |
kivy.require('1.8.1') | |
from kivy.app import App | |
from kivy.lang import Builder | |
root = Builder.load_string(''' | |
<Button>: | |
size_hint_y: None | |
height: sp(64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<BackgroundLabel>: | |
background_color: 0, 0, 0, 0 | |
canvas.before: | |
Color: | |
rgba: self.background_color | |
Rectangle: | |
pos: self.pos | |
size: self.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def func(which, *args): | |
def a(): pass | |
def b(): pass | |
def c(): pass | |
return locals()[which](*args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
root = Builder.load_string(''' | |
#:import WipeTransition kivy.uix.screenmanager.WipeTransition | |
ScreenManager: | |
transition: WipeTransition(clearcolor=(1, 1, 1, 1)) | |
Screen: | |
name: 's1' | |
Button: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.properties import StringProperty | |
class TestApp(App): | |
appabc = StringProperty('') | |
def build(self): | |
self.bind(appabc=self.root.setter('abc')) | |
self.appabc = 'hello' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kivy/app.py b/kivy/app.py | |
index db7e37c..f25c341 100644 | |
--- a/kivy/app.py | |
+++ b/kivy/app.py | |
@@ -803,8 +803,6 @@ class App(EventDispatcher): | |
if not isinstance(self.root, Widget): | |
Logger.critical('App.root must be an _instance_ of Widget') | |
raise Exception('Invalid instance in App.root') | |
- from kivy.core.window import Window | |
- Window.add_widget(self.root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#:import F kivy.factory.Factory | |
<TestView@ModalView>: | |
size_hint: .5, .5 | |
ScrollView: | |
size_hint: .9, .9 | |
pos_hint: {'center': (.5, .5)} | |
GridLayout: | |
cols: 10 | |
size_hint_y: None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kivy | |
kivy.require('1.8.1') | |
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.clock import Clock | |
root = Builder.load_string(''' | |
#:import Clock kivy.clock.Clock | |
FloatLayout: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import pydevd; pydevd.settrace('localhost', port=51514, suspend=False) | |
import sys | |
orientation = 'lr-tb' | |
if 'vertical' in sys.argv: | |
sys.argv.remove('vertical') | |
orientation = 'tb-lr' | |
from kivy.app import App | |
from kivy.uix.button import Button |