Skip to content

Instantly share code, notes, and snippets.

@cunidev
cunidev / moody-shapes.py
Last active April 12, 2024 19:50
Tutorial to rotate and zoom things (an useless rectangle here) using Gtk.Gesture touchpad and touchscreen gestures in Python GTK3 (gi) bindings. Spaghetti ahead!
#!/usr/bin/python3
# Needs Wayland!
import gi, math
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import cairo
dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.WARNING,
Gtk.ButtonsType.OK_CANCEL, "Press OK to test rotate")