Skip to content

Instantly share code, notes, and snippets.

View gottadiveintopython's full-sized avatar

水戸う納豆齋(Nattōsai Mitō) gottadiveintopython

View GitHub Profile
@gottadiveintopython
gottadiveintopython / manual_test_carousel2.py
Last active June 11, 2019 13:59
A tool for testing Carousel. It can dynamically change the properties.
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.app import runTouchApp
KV_CODE = '''
#:import random random
#:import Button kivy.uix.button.Button
<DebugCarousel@Carousel>:
@gottadiveintopython
gottadiveintopython / show_all_kivymd_icons.py
Last active August 23, 2024 23:29
Listing all icons available on KivyMD. You can easily see the name of an icon by pressing it.
'''
pip install kivy kivymd
'''
from kivy.lang import Builder
from kivy.properties import StringProperty
from kivymd.app import MDApp
from kivymd.uix.label import MDLabel
from kivymd.uix.snackbar.snackbar import MDSnackbar
@gottadiveintopython
gottadiveintopython / readme.txt
Last active November 12, 2023 13:36
async/await with Kivy (MIT LICENSE)
Moved to https://github.com/asyncgui/asynckivy
@gottadiveintopython
gottadiveintopython / main.py
Last active November 10, 2018 07:12
tkinter版のyieldsleep
from functools import wraps
def yieldsleep(widget):
def func(create_gen):
@wraps(create_gen)
def func2(*args, **kwargs):
gen = create_gen(*args, **kwargs)
def sleep(milliseconds):
@gottadiveintopython
gottadiveintopython / test_moretransitions.py
Last active January 29, 2022 02:03
kivy.garden.moretransitions が更新されたようなので試してみた
from kivy.app import runTouchApp
from kivy.lang import Builder
from kivy.uix.button import Button
from kivy.garden.moretransitions import (
PixelTransition, RippleTransition, BlurTransition, RVBTransition,
RotateTransition, TileTransition, FastSlideTransition,
)
ALL_TRANSITIONS = (
PixelTransition, RippleTransition, BlurTransition, RVBTransition,
@gottadiveintopython
gottadiveintopython / part1(fail).py
Last active October 10, 2018 06:45
あえてpos_hintを使わずに中央揃えを試みる
from kivy.config import Config
Config.set('graphics', 'width', 400)
Config.set('graphics', 'height', 300)
from kivy.app import runTouchApp
from kivy.lang import Builder
runTouchApp(Builder.load_string('''
FloatLayout:
Button:
text: 'Kivy'
@gottadiveintopython
gottadiveintopython / main.py
Created October 8, 2018 00:53
'Sequence.stop_property()' doesn't affect to the next part of the animation
# case A ... 'stop_property()' affects to the next part of the animation
# case B ... 'stop_property()' doesn't affect to the next part of the animation
#
# This behavior confuses users.
from kivy.animation import Animation
from kivy.app import runTouchApp
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.clock import Clock
@gottadiveintopython
gottadiveintopython / main.py
Last active October 8, 2018 00:03
A situation that 'Animation._instances' keeps getting fat.
# This script shows you a situation that 'Animation._instances' keeps getting
# fat. I'm not sure this should be fixed or not.
import gc
from kivy.animation import Animation
from kivy.app import runTouchApp
from kivy.uix.widget import Widget
from kivy.clock import Clock
@gottadiveintopython
gottadiveintopython / main.py
Last active July 8, 2018 20:20
OpenGL contextの消失への対応(WIP)
from __future__ import print_function
from kivy.config import Config
Config.set('kivy', 'pause_on_minimize', 1)
# Config.set('graphics', 'fullscreen', 1)
from kivy.app import App
from kivy.factory import Factory
from kivy.graphics.texture import Texture
import kivy.core.window
from sys import stderr