You should look at the description of "exportSelection" in the Tk::options man page -- although this may only be relevant if you're working in an X-Windows environment. If you're working with MS-Windows, I'm not sure how this plays out.

If you are using X-Windows, note that the X paste buffer can only work with one contiguous string at a time, and there is no way around this. That's why selecting one string will always deselect any other string -- except for Tk widgets where "exportSelection" is false, and in those cases, the highlighted string will stay highlighted when you select something else, but you won't be able to paste it anywhere.

Well, maybe there's a way to create or locate an "alternate" paste buffer, other than the "standard" X paste buffer that is normally manipulated with mouse buttons. This would be easy within the scope of a single Perl/Tk app, but more challenging across independent apps (think "inter-process communication").

I'm not sure, but I think that on MS-Windows, you have to specifically request that a highlighted string be copied into the window-manager's paste buffer in order to make it paste-able into another window. But again, only one contiguous string can be selected at a time for this sort of copying; (and I don't even know whether or not this is part of your question).


In reply to Re: maintaining selected elements in 2 Listboxes by graff
in thread maintaining selected elements in 2 Listboxes by evillerick

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.