Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!olivea!mintaka!bloom-beacon!eng.sun.COM!kasso From: kasso@eng.sun.COM (Chris Kasso) Newsgroups: comp.windows.x Subject: Re: Xview and cut & paste Message-ID: <9010240155.AA02206@aha.Eng.Sun.COM> Date: 24 Oct 90 01:55:20 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 55 From: "(Alain Brossard EPFL-SIC/SII)" Date: Tue, 23 Oct 90 09:34:54 PDT I'm having mucho problems with the interactions between the Athena Widgets and the xview programs when it relates to cut & paste. The Xaw, uses the primary selection: the left mouse button selects and the selection is put in the primary buffer. But what do the xview programs use? Their select has the same behavior so going from xview -> Xaw is easy. But where do the selections go when you press "Copy" or "Cut"? XView follows a model similar to SunView. Any text that is highlighted belongs to the PRIMARY selection. Pressing the ``Copy'' or ``Cut'' keys [Meta-c and Meta-x if you don't have a Sun keyboard] will result in the acquisition of the CLIPBOARD selection. The contents of the current selection will be placed on the CLIPBOARD selection or shelf as it was once known. Pressing the ``Paste'' key [Meta-v] will result in XView asking for the contents of the CLIPBOARD selection from the current owner, including SunView applications if you are running under OpenWindows. The miscommunications between XView and Xaw apps results from the fact that XView has no mechanism to ask for the contents of the PRIMARY selection and Xaw apps, by default, do not know how to ask for the contents of the CLIPBOARD selection. To remedy this, you can make Xaw apps aware of the CLIPBOARD selection by adding the following translations to a resource file: *VT100.Translations: #override \ L6: start-extend() select-end(PRIMARY, CLIPBOARD, CUT_BUFFER0)\n\ L8: insert-selection(CLIPBOARD) \n\ : select-end(CLIPBOARD) \n\ : insert-selection(PRIMARY,CLIPBOARD) \n\ : ignore() This allows you to use the Copy key to assert ownership of the CLIPBOARD selection and the Paste key to access the contents of the CLIPBOARD selection. Or, alternatively, use a mouse button 3 up event as a trigger to acquire the CLIPBOARD selection and button 2 up to access the contents of the CLIPBOARD if there currently is not a PRIMARY selection. One other possibility is to use xclipboard to move the selections from XView <=-=> Xaw. For more information on the use of the CLIPBOARD selection, refer to section 2.6.1.3 of the ICCCM. Alain Brossard, Ecole Polytechnique Federale de Lausanne, SIC/SII, EL-Ecublens, CH-1015 Lausanne, Suisse brossard@sasun1.epfl.ch Chris Kasso ARPA: kasso@sun.COM Window Systems Group UUCP: ...!sun!kasso Sun Microsystems, Inc.