UNIX clipboard?

UNIX clipboard?

Post by Chris Gillespi » Mon, 11 Dec 2000 09:01:27



Dear All,

Is there an area of memory shared by all processes in UNIX

for the usage of cut/copy/paste operations. I beleive WIndows

has a clipboard for this purpose. The reason I ask is because I

want to be able to copy some text from a piece of software i.e

Netscape, and paste it into my own.

Thanks,

Chris.

 
 
 

UNIX clipboard?

Post by Nikolai Hristo » Sun, 10 Dec 2000 22:08:58


I am not sure that this is the newsgroup that you should be posting
to....

but, anyway, in Linux there is,.... it is a feature of gpm...

select the text, move the cursor into the position where you want to
paste and press mouse buttn 3

Nick



> Dear All,

> Is there an area of memory shared by all processes in UNIX

> for the usage of cut/copy/paste operations. I beleive WIndows

> has a clipboard for this purpose. The reason I ask is because I

> want to be able to copy some text from a piece of software i.e

> Netscape, and paste it into my own.

> Thanks,

> Chris.

--

------------------
Nikolai Hristov
Denison University
Granville OH 43023


740-587-9272

 
 
 

UNIX clipboard?

Post by Peter Roozemaa » Mon, 11 Dec 2000 20:35:38



> Is there an area of memory shared by all processes in UNIX
> for the usage of cut/copy/paste operations. I beleive WIndows
> has a clipboard for this purpose. The reason I ask is because I
> want to be able to copy some text from a piece of software i.e
> Netscape, and paste it into my own.

There is no "global" clipboard under UNIX. UNIX is a multi-user OS and
it could be very embarassing when someone incidently pasted some of your
clippings in his document. The X server allows copy and paste
functionality between different X window applications. You can make a
selection in one of the windows and copy the content of the current
selection into one of your windows. The middle mouse button is commonly
used for this purpose. Under Linux gpm provides similar functionality
for the text console.

Peter

 
 
 

UNIX clipboard?

Post by Russ Bix » Fri, 15 Dec 2000 05:16:00


: >
: > Is there an area of memory shared by all processes in UNIX
: > for the usage of cut/copy/paste operations. I beleive WIndows
: > has a clipboard for this purpose. The reason I ask is because I
: > want to be able to copy some text from a piece of software i.e
: > Netscape, and paste it into my own.
: >
: There is no "global" clipboard under UNIX. UNIX is a multi-user OS and
: it could be very embarassing when someone incidently pasted some of your
: clippings in his document. The X server allows copy and paste
: functionality between different X window applications. You can make a
: selection in one of the windows and copy the content of the current
: selection into one of your windows. The middle mouse button is commonly
: used for this purpose. Under Linux gpm provides similar functionality
: for the text console.

A note about Netscape:

While a right button drag to select and a middle button paste will work,
when going to an xterm or some other programs, the text must still be
highlighted in Netscape;  the paste bufferwise provides its earlier
contents.

Please do experiment with this, as the who will do what in which manner
to whom will vary with the application, the X server and the OS.

This is because there is no "rich" standard, and Netscape ignores a few
rules to add "features."

Narf,

Russ, geek at large

: Peter

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

UNIX clipboard?

Post by Victor Wagn » Tue, 19 Dec 2000 06:27:57


: Dear All,

: Is there an area of memory shared by all processes in UNIX
: for the usage of cut/copy/paste operations. I beleive WIndows
: has a clipboard for this purpose. The reason I ask is because I
: want to be able to copy some text from a piece of software i.e
: Netscape, and paste it into my own.

There is much better thing - several common buffers shared between all
programs on one X display, regardless of machine they run on.
(you are surprised that program which is displayed on your screen
can run on opposite side of world? But it is so since 1985 when X was
invented. Just today I've worked with program running in California,
sitting in my office in Moscow, Russia. Yes, it is a bit slow,
especially through three firewalls and four ssh port forwarding, but
it works).

It is called X selection.

Actually, there are lot of such buffers, but two ones are widely used:

primary selection and X clipboard.

When you highlight some text by dragging mouse in Xterm or netscape,
it automatically becomes content of primary selection, and can be pasted
in any application. Pasting is done by pressing middle button.

If you paste it in xterm, non-x program running inside Xterm would think
it is typed in from keyboard.

If non-x program knows how to use mouse by itself, such as pine or
midnight commander, it intercerts simple clicks and drags. So, you'll
have to press Shift while selecting and pasting.

X clipboard doesn't have so handy default mouse bindings. It is
responsibility of application to copy primary selection there and
paste it back. (there is xclipboard program to help stupid apps which
cannot do it by itself) Netscape, as well as most other Motif apps
knows how to work with clipboard. And it interoperates with other
toolkit apps nicely. At least I've no problems cutting and pasting
from Netscape to my Tcl/Tk script and vice versa.

Code for cut and paste is:

$m add command -label Cut -command {CopySel;
    .text delete sel.first sel.last;set changed 1} -accelerator Ctrl-X
$m add command -label Copy -command CopySel -accelerator Ctrl-C
$m add command -label Paste -accelerator Ctrl-V -command \
       {TextInsert [selection get -selection CLIPBOARD]}
proc CopySel {} {
  clipboard clear
  clipboard append -- [.text get sel.first sel.last]

Quote:}

where selection and clipboard are Tk builtin commands.

(of course this text have come from source file to this letter via
X primary selection)

Most other toolkits know how to work with various X selections too.

I'm only not sure about Gtk. If they ignore X resources and uses their
own .gtkrc which doesn't allow preprocessing and doesn't allow
different resources for different login sessions on same machine,
depending from terminal one've logged in, they can do same stupid thing
about X selections.

: Thanks,

: Chris.

--
Save yourself from the 'Gates' of hell, use Linux."  -- like that one.

 
 
 

1. Sun clipboard & Motif clipboard == crash

We currently have a very serious problem with our Motif application on
Sun workstations, actually any workstation running a Sun application
has the same problem.  When the user has used the Sun application to
copy something to the Clipboard the Motif applicaiton will core dump
if it calls XmClipboardInquireCount!!

Here are the exact details --

First copy any item to the clipboard using a Sun application.  You
can use a command tool, the file manager, or any app that will copy
items to the Sun clipboard.  If you then call the Motif Clipboard call
XmClipboardInquireCount after the item has been copied to the clipboard
the Motif function will cause a core dump on a strlen after you receive
a X-Window error describing that a BadAtom has been referenced with a
atom number of 0.

The Motif guide lines suggest you call XmClipboardInquireCount to get
an idea of how many formats are available for the data on the clipboard.

I'm not sure exactly why the crash occurs, or why this call causes a
BadAtom error with a atom id of 0.

I do know that if you do not call this function but rather blindly
inquire the formats registered you will not get the fatal core dump,
you will however get the BadAtom error, so if you are not trapping for
the X-Errors you will get a fatal error.

Has anyone experienced this problem?  What are other developers doing
when it comes to inter-application Copy&Cut with Olwm and Motif apps?

Any help would be greatly appreciated.  I have example code to demonstrate
this problem available on request.

Scott Piette
Spyglass Inc.

2. How to check the remained disk size in Linux

3. Mac clipboard style cut and paste in Unix

4. athlon quantispeed

5. Mozilla 1.6 and 1.7 copy clipboard bug

6. PKI on FreeBSD

7. A good clipboard/clipbook for X (GNOME)?

8. test, don't read

9. clipboard buffer size (XWindows)

10. load text into clipboard?

11. Clipboard prg?

12. xterm clipboard transfer

13. clipboard in KDE not working with Netscape--pls help