Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-05

Clipbrd unit

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

I'm trying to understand the clipbrd unit. There are three types of clipboard, what are they ?

Another question is, how can I register myself as a clipboard listener (like in Windows, but cross platform) ?

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.

Thanks,

Ido

Reply by email

Mattias Gaertner
to ik
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

Reply by email