Skip navigation.
 
mlRe: Watching a pasteboard
FROM : Massimiliano Origgi
DATE : Mon Apr 04 10:04:14 2005

Il giorno 03/apr/05, alle 17:08, Heinrich Giesen ha scritto:

>
> On 02.04.2005, at 18:25, Massimiliano Origgi wrote:

>> Is it possible to be notified in some way when the contents of a
>> pasteboard get changed?

> No.


OK, I haven't missed something so. Time for a feature request, if it
hasn't been implemented in Tiger...

>

>> The only solution so far would be to poll for the change count value,

> Yes.
>

>> but clearly it's ugly

> No, it's common for a lot of UNIX tasks


Yep, but in general polling is not really nice.

>

>> inefficient

> No
> If you set a timer that fires two or three times per second the
> cpu usage is within microseconds. I did so for an application
> that permanently observes changes on the pasteboard server
> and shows the current contents of the several pasteboards.
> For me it worked perfectly


Nice to hear from you that it works well. My reference to inefficiency
was mainly related to the efficiency of a system notification, but I
had some doubts about the performance of the pasteboard object as it
may require interprocess communication to obtain the data (I haven't
yet tested the code).
Anyway as I'll be watching the normal pasteboard for now, a couple of
times per second should be enough to achieve a good reaction time to
user actions.
Thanks.

Massimiliano Origgi
   http://www.intuiware.com
       Coming Soon...

Related mailsAuthorDate
mlWatching a pasteboard Massimiliano Origg… Apr 2, 13:09
mlRe: Watching a pasteboard Heinrich Giesen Apr 3, 17:08
mlRe: Watching a pasteboard Massimiliano Origg… Apr 4, 10:04
mlRe: Watching a pasteboard Andreas Mayer Apr 4, 14:37
mlRe: Watching a pasteboard Massimiliano Origg… Apr 4, 18:35