|
From: Daniel J S. <dan...@ie...> - 2006-07-14 22:13:49
|
Ethan Merritt wrote:
> On Friday 14 July 2006 10:56 am, Bob Fletcher wrote:
>
>>Shoot! Well, I tried all of the obvious things - except KDE and
>>klipper. (I am having enough 'fun' trying to learn GNOME.) The
>>cut/paste operation is very erratic and usually will not work. As
>>suggested by others, I tried entering "e" for replot with no results.
>>I guess I am having the same sort of flaky performance described by
>>Dmitri.
>
>
> Part of the confusion in an earlier post is the expectation that you
> can "copy" once, and "paste" multiple times from it. This is not
> true for gnuplot+X11 by default. An pixel image placed on the
> clipboard can be pasted elsewhere, but then it's not on the clipboard
> any more.
I'm not an X-pert (the usual disclaimer), but I believe there is indeed some confusion here, and I think it is with the phrase "clipboard". From what I'm seeing in the code, this feature of being able to copy the X11 gnuplot image is not using the clipboard. It is using some kind of X11 scheme of "atoms" and is more in the line of a "selection" in this case.
XSetSelectionOwner(dpy, EXPORT_SELECTION, plot->window, CurrentTime);
I intentionally did not use the term "clipboard" above. A "selection" I'm guessing is more like the center mouse behavior we come to think of in X, i.e., one can quickly hilight a chunk of text in one window and copy it into another window.
"clipboard" would be more like CNTR-C saves it into a cut buffer where the data sits, CNTR-V then recalls that data.
"clipboard" is more permanent, "selection" is more ephemeral. So I think in this case the gnuplot image is "selected" inherently when the plot is done. But after copying the image once into OpenWrite, the gnuplot image becomes "deselected" or out of scope somehow. To verify this, after creating the image, use the center mouse button to select something else; anything. The center mouse button no longer places the gnuplot image in OpenWRite.
OK, so first point:
1) The phrase "clipboard" shouldn't be used the way gnuplot is currently program.
2) Well, it would be nice if this behavior were more in line with typically X applications. That is, this "selection" feature should not be driven by the plotting action, but by some kind of mouse action. The phrase I see at:
http://tronche.com/gui/x/xlib/window-information/selection.html
is ``the last thing the user clicked on''. So it would be nice if there were a mouse action that would cause the X11 gnuplot image to be the "selection", and when this happens the typical thing is for the object in question to be highlighted in contrast colors or XOR-ed with a blue shade or something--like what happens in a web browser.
3) This thing about being able to copy the "selected" image repeatedly... That is a bit peculiar because with other X11 windows things that have been "selected" can be copied time and again so long as they are not deselected. So, it seems we should be able to improve upon that part somehow and get rid of this "sometimes works, sometimes not" kind of thing.
As an example, in a web browser I've selected an image from a local newspaper's website. I can continually copy the "selection" into OpenWrite. First there is some text that appears with the caption and then that is replaced by the image. I keep pressing the center button and keep getting a new image.
4) As for "clipboard". There may be some way of actually doing that as well via X functions. There is this thing called interclient communication functions:
http://tronche.com/gui/x/xlib/ICC/
which appears to deal with Window Managers in some way. However...
Before going down that path, I'm wondering if the actual clipboard can't be made easier than that. Most of these X applications, once something is "selected", almost always seem to be "clipboard-able" by typing, in my case, CNTRL-C/CNTRL-V. So, right now supposedly Gnuplot is "selecting" the plot inherently upon "plot <foo>". Does the gnuplot X window pass the keyboard sequence down the line if it doesn't interpret the key sequence it receives? (I type 'h' right now for a list of keystroke interpretations and don't see a CNTRL-C in the list.) I'm just wondering right now why the inherently selected X11 gnuplot image can't be copied to the clipboard buffer with CNTRL-C.
> Taking a step to the side ...
There are advantages to this.
Dan
|