I am able to copy within a Perl-Tk application, but not able to paste externally to an X terminal window or a Konsole window. Within the Tk app, I am using ROText. I highlight the text with the mouse and upon Button-1 release, I have the text in a variable. I have tried the solutions in Mastering Perl-Tk, but to no avail. I may be overthinking this problem. I was under the impression that copy/paste should be pretty much automatic. I bind Button-1-release to capture the mouse event and use a callback. I have tried the clipboard commands but they don't work for me.

Does anyone have ideas or sample code that works?

I can't show the code I have, but I can say that when I copy by dragging the mouse over the characters originally, it copied nothing. I did a bind of Button-1-release and I could then capture the characters, but I could only paste within the Tk application. In your example below, you are not doing anything special, so how are you able to copy/paste outside of the script. If I unbind Button-1-release, I can't even perform the copy.

In reply to Perl-Tk copy/paste to X terminal by dadenn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.