Michael JasonSmith wrote:

>On Tue, 2002-05-28 at 16:56, Seth Kurtzberg wrote:
>  
>
>>My problem is slightly different; I'm copying from a pygtk application to a 
>>legacy application using the clipboard.  With the code in the selection.py 
>>sample file, the middle button paste works but a paste from the taskbar (in 
>>gnome-terminal, for example) doesn't work. 
>>    
>>
>[snip]
>  
>
>>Obviously I'm missing something.  Is this related to selection names, such as 
>>GDK_SELECTION_PRIMARY (which I just copied under emacs, and pasted under 
>>kmail, and both middle button and edit/paste work, so it is possible).
>>    
>>
>Ahhh, the Joy of X Selections :)  You are correct, there are multiple
>selections and how you select something affects which one is used.
>
>When you select something using click and drag, and paste using the
>middle mouse-button, the PRIMARY selection is used.  When you select
>something and use "Cut", or "Copy" from the menu, the CLIPBOARD
>selection is used.
>
>The closest thing to a standard is 
>       http://www.freedesktop.org/standards/clipboards.txt
>To handle legacy apps you have to put the data in both, IIRC.
>  
>
The general concensus is to just do it right in your apps.  If you use 
the cut/copy menu items in an app, then the CLIPBOARD selection is 
claimed.  When you select some text, the app should be claiming the 
PRIMARY selection.  Doing anything different will lead to a more broken 
and confusing desktop (You will find that users get really pissed off 
when the contents of their clipboard disapear because they selected some 
text).  If you don't make the distinction between PRIMARY and CLIPBOARD, 
then some operations are impossible (such as selecting some text, then 
choosing paste from the menus to replace the selected text with the 
contents of the clipboard).

Gtk gets it right.  Qt 3.0 (and probably 2.x) get it right.  Emacs 21 
gets it right.  Mozilla sometimes gets it wrong.  Please try to make 
sure your apps are in the "got it right" pile, rather than the broken pile.

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