Skip to content

Instantly share code, notes, and snippets.

View tito's full-sized avatar

Mathieu Virbel tito

View GitHub Profile
class ConnectionButton(MTWidget):
instances = []
def __init__(self, **kwargs):
super().__init__(**kwargs)
ConnectionButton.instances.append(self)
def on_touch_down(self, touch):
if not self.collide_point(*touch.pos):
return
# ================================================================================
# Project: Kivy.Statechart - A Statechart Framework for Kivy
# Copyright: ©2010, 2011 Michael Cohen, and contributors.
# Python Port: Jeff Pittman, ported from SproutCore, SC.Statechart
# ================================================================================
from kivy.statechart.system.state import State
from kivy.statechart.mixins.statechart_delegate import StatechartDelegate
from kivy.properties import AliasProperty
from kivy.logger import Logger
@tito
tito / test.py
Created May 3, 2012 22:38 — forked from tshirtman/test.py
#!/usr/bin/env python
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty, NumericProperty
from kivy.lang import Builder
Builder.load_string('''
<ArrowPointer>:
canvas:
Color:
import kivy
kivy.require('1.0.7')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ListProperty
from kivy.lang import Builder
Builder.load_string('''
''':class:`~kivy.properties.ListProperty`, defaults to [], equal to '\*'.
The filters to be applied to the files in the directory.
The filters are not reset when the path changes. You need to do that
yourself if desired.
There are two kinds of filters :
filename patterns : e.g. ['\*.png'].
You can use the following patterns:
diff --git a/kivy/lang.py b/kivy/lang.py
index 10cdd21..5fa43bc 100644
--- a/kivy/lang.py
+++ b/kivy/lang.py
@@ -613,6 +613,7 @@ class ParserRule(object):
'''
__slots__ = ('ctx', 'line', 'name', 'children', 'id', 'properties',
+ 'nested_properties',
'canvas_before', 'canvas_root', 'canvas_after',
@tito
tito / main.py
Created December 7, 2012 01:58 — forked from DaniZz/main.py
the whole thing
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.graphics import Color, Ellipse, Line
from kivy.graphics.instructions import Callback
from kivy.uix.boxlayout import BoxLayout
from kivy.core.window import Window
from kivy.interactive import InteractiveLauncher
from kivy.properties import NumericProperty
from kivy.event import EventDispatcher
@tito
tito / cpuradialgradient.py
Created December 10, 2012 12:36 — forked from tshirtman/radial_gradient.py
radial gradient texture for kivy
from kivy.graphics.texture import Texture
from kivy.graphics import Rectangle, Color
from kivy.uix.widget import Widget
from kivy.graphics.opengl import glFinish
from kivy.app import App
from time import time
class RadialGradient(App):
def build(self):
@tito
tito / chwall.py
Last active December 12, 2015 03:19
from jnius import autoclass
WallpaperManager = autoclass('android.app.WallpaperManager')
PythonActivity = autoclass('org.renpy.android.PythonActivity')
manager = WallpaperManager.getInstance(PythonActivity.mActivity)
manager.clear()
#:kivy 1.5.1
#:import kivy kivy
<FirstWidget>
GridLayout:
size: root.size
rows: 2
Label: