With PyGTK 2, I could add a function that will execute when the contents of the clipboard change. View Python GTK3 Communications Documentation I cannot find any description of this functionality.
Can someone tell me โbest practiceโ for this?
EDIT
Gtk2 does the following work:
import gtk def test(*args): print "Clipboard changed" clip = gtk.Clipboard() clip.connect('owner-change',test)
When upgrading to Gtk3
from gi.repository import Gtk, Gdk def test(*args): print "Clipboard changed" clip = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) clip.Connect('owner-change',test)
Python accepts a connection to a signal, but my function is never executed.
source share