From: Tracubik on 8 Apr 2010 11:57 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
|
Pages: 1 Prev: Py3: Read file with Unicode characters Next: Generating a rainbow? |