O'Mighty Monks, I come before you weak and powerless to solve this problem, please grant me the wisdom and strength I require. I have searched long and hard, crossed the desert of google, tretched through the Perl jungle, but my vision eludes me still.

I am trying to create a TKX Cut,Copy,Paste popup menu. I've successfully been able to create the popup... but every attempt I've made to copy fails, selected text fails.

Also as an extra layer of problems all my windows are being created dynamically, I believe the problem may be that the window the mouse is on when calling the copy is not the same window that the copy is being copied from.... Below is code that I have cut up/ re hashed/ diced / and smashed, and nothing that comes out of it works.

sub popup { my $current_window = $_[0]; #value that has the screen it's on print "- $current_window\n"; my $pop_menu = $mw->new_menu; my $popup_menu = $pop_menu->new_menu(-tearoff => 0,); $popup_menu->add_command(-label => "Copy",-underline => 1,-command + => sub { [\&Tkx::event_generate,$mw,"<<Copy>>"] }); Tkx::bind($mw,"<3>", [ sub { my($x,$y) = @_; foreach my $i (@_) { print "$i\n"; ##Most of the values I get from TXK:Ev are ?? } $popup_menu->g_tk___popup($x,$y) } ,Tkx::Ev("%X", "%Y","%a","%B","%b","%c","%D","%d","%f","%h","% +K","%m","%o","%R","%E","%#","%s","%S","%t","%w") ] ); } popup($window);

Your help would be much appreciated. Thank you.
v/r
Anthony


In reply to TKX Popup Menu by Jukari

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.