Hey Tom,

Just to give a little more info specific to X that may help answer your
question.

The X protocol has the concept of "The X Selection". There are 2 such
channels, called PRIMARY and SECONDARY (I don't recall seeing an app use
SECONDARY..)

Interesting model is that ONLY ONE app can "own" the X Selection at
a given time. You can see this if you have two xterms running: Select
text in one, then select text in the 2nd and you see you lose the
selection in the first. The X server manages this "communication channel".

Of course an X app can "highlight" any text it wants to, but not export
it to the X Selection.

Now, the X app can choose to export its selection by whatever events it
wants to. For example the user dragging to highlight some text can
be the action to export the selection. (xterm and most X app do this)

However, the app could decide it doesn't want to do that. So it might
merely highlight/color the dragged out text, and they require the 
user to go thru the Edit->Copy event before exporting the X selection
to PRIMARY. Netscape "sometimes" does this...

There are also 8 slots called "cutbuffers" CUT_BUFFER0, ... CUT_BUFFER7
that are similar to the X selection, but the app deposits "text" there
and no longer owns it (e.g. when the app exits the CUT_BUFFER data will
still be there, but not so if that app owned PRIMARY before it exited).
cutbuffers are occasionally useful, but are not used as often as
PRIMARY selection.

Windoze users might be confused and/or upset that selecting text in
one app unselects it in another. They might think "how stupid!". 
However, I really like this model. It saves the extra steps of the
user manually exporting to the communications channel. You can really
move text around easily.

Two useful command line apps that unfortunately don't come with
most Linux distributions are xselection(1) and xcb(1) (x cutbuffer).
These are useful for embedding selection reading/setting in shell
and perl scripts. And also for debugging where selections are going.
You can get them from "contrib" at ftp.x.org I believe.

I have also written a little tcl/tk script that does similar things to
xselection (at least tk is on most linux boxes).  An application of
this is a little script I call "url" that will launch netscape to
a url given on the command line, however if the command line is empty
it uses the X selection (and if that is empty uses cutbuffer0!).
Very powerful little script. I bind it to a "HotKey" and FvwmButtons
button under fvwm.

Hope this helps,

Karl


On Tue, 4 Apr 2000, tom r <[EMAIL PROTECTED]> wrote:
> 
> Can anybody explain the real difference between highlighting some text with the
> mouse and then going to a different window and hitting the middle mouse button
> to paste the text, and highlighting some text, going to the edit menu bar menu,
> selecting "copy" and then going to a different window and using "paste" from
> the menu ?


**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************
  • X tom r
    • Re: X Rodent of Unusual Size
    • Karl J. Runge

Reply via email to