[pygtk] Tutorial Clipboard.py

mc collilieux mccnews at free.fr
Wed Jul 19 07:29:02 WST 2006


John Finlay wrote:
> mc collilieux wrote:
> 
>>Hello, I try to run the example program of clipboard but it does not 
>>work with me :-(

> 
> It's broken. Specifically the clipboard_text_received() method is 
> broken. Try the attached instead.
> 
>     def clipboard_text_received(self, clipboard, text, data):
>         if not text or text == '':
>             return
>         cbi = ClipboardInfo()
>         cbi.text = text
>         # prepend and remove duplicate
>         self.clipboard_history = ([cbi]
>                                   + [info for info in self.clipboard_history
>                                      if info and info.text<>text])[:10]
>         self.clipboard.request_targets(self.clipboard_targets_received, cbi)
>         return
>


It works better, thanks.

I had tried but not succeeded in transforming the contents of 
self.clipboard_history.
Now with more training...

And thanks for all the tutorial !
-- 
Marie-Claude Collilieux
Bretagne


More information about the pygtk mailing list