Skip to content

Instantly share code, notes, and snippets.

@tshirtman
tshirtman / recycled_checkboxes.py
Last active November 26, 2019 14:39
use CheckBox/RadioButton in kivy's RecycleView
from kivy.lang import Builder
from kivy.app import App
from kivy.properties import ListProperty, NumericProperty
KV = '''
#:import RGBA kivy.utils.rgba
<Row@BoxLayout>:
text: ''
rv_key: 0
@tshirtman
tshirtman / test_anim.py
Last active April 5, 2019 02:45
A simple example of animating a graphical instruction of a widget from a keyboard event.
from kivy.app import App
from kivy.animation import Animation
from kivy.lang import Builder
from kivy.properties import NumericProperty
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
KV = '''
FloatLayout:
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.properties import ListProperty, NumericProperty
from kivy.metrics import dp
KV = '''
#:import chain itertools.chain
FloatLayout:
@tshirtman
tshirtman / nodes.py
Last active April 14, 2023 18:02
A really simple example of free node manipulations in kivy with a bezier line in between.
from kivy.lang import Builder
from kivy.app import App
KV = '''
<Node@Scatter>:
# do_scale: False
# do_rotation: False
size_hint: None, None
size: 200, 100
color: [0, 0, 0, 1]
@joyrexus
joyrexus / README.md
Last active June 12, 2025 20:55
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
from kivy.uix.boxlayout import BoxLayout
from kivy.app import App
from kivy.uix.button import Button
from functools import partial
class DemoBox(BoxLayout):
def __init__(self, **kwargs):
super(DemoBox, self).__init__(**kwargs)
self.orientation = "vertical"
from kivy.app import App
from kivy.lang import Builder
from kivy.properties import ObjectProperty, OptionProperty, StringProperty, NumericProperty
from kivy.uix.effectwidget import AdvancedEffectBase, EffectWidget
from kivy.graphics import BindTexture
from kivy.clock import Clock
GLSL = '''
uniform sampler2D mask;
uniform vec2 mask_pos;
"""Hoverable Behaviour (changing when the mouse is on the widget by O. Poyen.
License: LGPL
"""
__author__ = 'Olivier POYEN'
from kivy.properties import BooleanProperty, ObjectProperty
from kivy.core.window import Window
class HoverBehavior(object):
@tito
tito / inspector3d.py
Last active June 7, 2022 22:23
Inspector 3d - WIP
__all__ = ('start', 'stop')
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import BooleanProperty, ObjectProperty, \
NumericProperty
from kivy.graphics import Fbo, ClearColor, ClearBuffers, \
RenderContext, Callback, PushMatrix, PopMatrix, \
Color, Translate, Rotate, Mesh, UpdateNormalMatrix, \
Canvas, Line