Skip to content

Commit

Permalink
Fix Gtk Clipboard TypeError
Browse files Browse the repository at this point in the history
add len argument in Gtk.Clipboard set_text method
set len=-1

Fixes Error:
TypeError: Gtk.Clipboard.set_text() takes exactly 3 arguments (2 given)
  • Loading branch information
Saumya-Mishra9129 committed Jun 22, 2020
1 parent a40cfd3 commit d88651f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SearchActivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def _write_scores_to_clipboard(self, button=None):
scores = ''
for i, s in enumerate(self.all_scores):
scores += '%s: %s\n' % (str(i + 1), s)
Gtk.Clipboard().set_text(scores)
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
clipboard.set_text(scores,-1)

# Collaboration-related methods

Expand Down

0 comments on commit d88651f

Please sign in to comment.