Skip to content

Instantly share code, notes, and snippets.

@StanGenchev
StanGenchev / gtk-get-screen-workarea.py
Created December 22, 2019 12:01
Example showing how to get monitor resolution and/or work area in Python 3 and Gtk 3.22+.
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
import sys
class MyWindow(Gtk.ApplicationWindow):
def __init__(self, app):
Gtk.Window.__init__(self, title="Gtk get screen workarea", application=app)
# from: https://doc.qt.io/qt-5/qtcharts-nesteddonuts-example.html
import functools
import random
from PyQt5.QtChart import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
class Widget(QWidget):
@quasoft
quasoft / gst_playbin_sink_example.py
Created October 8, 2016 19:10
Using GStreamer with playbin and custom sink as radio player
#!/usr/bin/env python3
import gi
import threading
gi.require_version('Gst', '1.0')
gi.require_version('GstBase', '1.0')
gi.require_version('Gtk', '3.0')
from gi.repository import GObject, Gst
# Initialize threads
GObject.threads_init()
@koohz
koohz / PyGObject.TreeView-Multi-Column-Filtering.py
Last active February 10, 2021 14:01
A PyGtk example for filtering multiple columns in a TreeView
#!/usr/bin/python
from gi.repository import Gtk
import random
DUMMY_WORDS = '''Omnisciently sepulture innervating reducate louden fleming
psoatic opinionatedly upington unmistrusted psychognosis
jackfish tutankhamen piled Hyperpotassemia schopenhauerism
venomness grendel bleakly unbungling dolius proempiricist
ableptically siniju woolley giulietta semisentimentalized
tolerably Moultrie prelawful prague mangler gainfulness