From: Tracubik on
Hi all,
i'ld like to create an gnome applet in python that, if left-clicked,
perform a particular operation using the text of the clipboard.

i've found this example:

import pygtk
pygtk.require('2.0')
import gtk

# get the clipboard
clipboard = gtk.clipboard_get()

# read the clipboard text data. you can also read image and
# rich text clipboard data with the
# wait_for_image and wait_for_rich_text methods.
text = clipboard.wait_for_text()

this work with cut and paste direct operation, but it doesn't catch a
selected text (that can be pasted for example in a document via the middle
clik of the mouse)

Any hints?
Nico