From 7e8c95bb1a28cd72a5832c6fa11b2d417e4d4437 Mon Sep 17 00:00:00 2001 From: adrianiainlam Date: Fri, 11 Mar 2016 19:05:15 +0000 Subject: [PATCH] Fix TypeErrors due to Gtk.Clipboard API difference between PyGTK and PyGObject --- indicator-chars.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indicator-chars.py b/indicator-chars.py index 3edfa5a..620a8f9 100755 --- a/indicator-chars.py +++ b/indicator-chars.py @@ -36,7 +36,7 @@ import os import re -from gi.repository import Gtk, Gio, AppIndicator3 +from gi.repository import Gdk, Gtk, Gio, AppIndicator3 import signal import subprocess @@ -116,10 +116,10 @@ class IndicatorChars: menu.show_all() def on_char_click(self, widget, char): - cb = Gtk.Clipboard(selection="PRIMARY") - cb.set_text(char) - cb = Gtk.Clipboard(selection="CLIPBOARD") - cb.set_text(char) + cb = Gtk.Clipboard.get(Gdk.Atom.intern("PRIMARY", False)) + cb.set_text(char, -1) + cb = Gtk.Clipboard.get(Gdk.Atom.intern("CLIPBOARD", False)) + cb.set_text(char, -1) def on_quit(self, widget): Gtk.main_quit() -- 2.7.4