Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyGTK: how to make a clipboard monitor?

How can I make a simple clipboard monitor in Python using the PyGTK GUI?

I found gtk.clipboard class and but I couldn't find any solution to get the "signals" to trigger the event when the clipboard content has changed.

Any ideas?

like image 355
envy Avatar asked Jun 09 '10 11:06

envy


1 Answers

Without a proper notification API, such as WM_DrawClipboard messages, you would probably have to resort to a polling loop. And then you will cause major conflicts with other apps that are trying to use this shared resource.
Do not resort to a polling loop.

like image 53
Chris Thornton Avatar answered Sep 27 '22 16:09

Chris Thornton