[Lazarus] Clipbrd unit
Mattias Gaertner
nc-gaertnma at netcologne.de
Mon May 12 13:43:33 CEST 2008
On Fri, 9 May 2008 23:42:09 +0300
ik <idokan at gmail.com> wrote:
> Hello,
>
> I'm trying to understand the clipbrd unit. There are three types of
> clipboard, what are they ?
ClipBoard: Normally used by Copy/Paste.
PrimarySelection: Normally used by selecting some text with the mouse
and pasting it with middle mouse button. Works between applications
only on X.
SecondarySelection: X provides a dozen more selections, but afaik they
are hardly used. There is no standard how to use them. Be creative.
There is one big difference between ClipBoard and the Selections:
Copy/Paste normally copy the content instantly onto a globally shared
space. That means, when the application is closed the content is still
there.
The selections do not store anything. An application can just
take ownership and when another application request the content, an
OnRequest event is triggered a stream is transfered.
> Another question is, how can I register myself as a clipboard listener
> (like in Windows, but cross platform) ?
I don't know, what a clipboard listener under ms windows exactly does,
so I leave this question to some win32 devel.
> And last but not least, what exactly does the OnRequest event does ?
> it triggers in my system only after things are starting to be free.
The OnRequest event is mostly for the client server selections on X.
They are probably not very useful for the ClipBoard.
In fact the Clipboard under X is just another selection, but the LCL
tries to map this to a ms windows like clipboard.
Mattias
More information about the Lazarus
mailing list