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