Ricardo Froehlich wrote:

>       Hello,
>
>       I appreciate last help I had from Jon Nelson, the link he suggested is
>great, but there is still one problem: if I close my app, the string I copied
>is removed from the X clipboard.
>       Unfortunately the tutorial didn't say anything about it. How do I make
>the string stay in the clipboard, even when I close my app? Am I missing any
>detail?
>  
>
X selection handling is an asynchronous operation.  When a user "copies" 
some text to the clipboard, the text doesn't necessarily get copied 
anywhere.  Instead, the application claims the CLIPBOARD selection. When 
another app wants to paste the contents of the clipboard, they request 
the contents of the CLIPBOARD selection in a particular format (eg. UTF8 
text, html, an image, etc), which sends a message to the first app.  The 
first app then sends the data back in the requested format.  This has 
the benefit that no data is sent over the wire until it is requested, 
and content type negotiation can be performed.

As you can see, this model breaks down when the selection owner window 
gets destroyed.  There are some tools to work around this problem such 
as xclipboard.  The downside to xclipboard is that every time the 
CLIPBOARD selection is claimed, the data gets requested by xclipboard, 
and xclipboard will only store the data in one format.

James.

-- 
Email: [EMAIL PROTECTED]              | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to