How do I paste HTML data from the X clipboard using PyGTK/GTK+?
I would need something like xclip, but with the ability to output clipboard data as HTML, not just as plain text. I’m using PyGTK, but I am not afraid of plain GTK+ in C.
I’ve read GtkClipboard and PyGTK’s gtk.Clipboard references, and I’ve found this question, but I would need a small example to get me started.
Updated answer
The original answer (below) used an old API, here is an updated version:
Note also that your application may use a different target than "text/html": you can check which targets are available with:
Original answer
Found it. I used something like this:
And then the callback function can simply extract the data: