2

I downloaded Indicator-Char and unzipped the files. I added the characters there I wanted perfectly. When I run the python script it loads the daemon and I can see this characters. But the problem is that when I click on them, the app doesn't copy anything to the clipboard.

The following code belongs to the copy function of the program:

def on_char_click(self, widget, char):
    cb = gtk.Clipboard(selection="PRIMARY")
    cb.set_text(char)

Is a syntax problem? There is a problem on my system?

1 Answer 1

2

From http://standards.freedesktop.org/clipboards-spec/clipboards-latest.txt:

  • explicit cut/copy commands should always set both CLIPBOARD and PRIMARY, even when copying doesn't involve a selection (e.g. a "copy url" -option which explicitly copies an url without the url being selected first)

Copy char command could look like this:

cb = gtk.Clipboard(selection="PRIMARY")
cb.set_text(char)
cb = gtk.Clipboard(selection="CLIPBOARD")
cb.set_text(char)

From the same link:

Apps that follow these guidelines give users a simple mental model to understand what's going on. PRIMARY is the current selection. Middle button pastes the current selection. CLIPBOARD is just like on Mac/Windows. You don't have to know about PRIMARY if you're a newbie.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .