Thanks folks but I figured it out. Code Below creates a popup menu on location, and copys from the frame it's on.
sub popup
{
Tkx::bind($mw,"<3>",
[
sub
{
my($x,$y) = @_;
my $current_window = Tkx::winfo('containing',$x,$y);
my $pop_menu = $mw->new_menu;
my $popup_menu = $pop_menu->new_menu(-tearoff => 0,);
$popup_menu->add_command(-label => "Copy",-underline => 1,
+-command => [\&Tkx::event_generate,"$current_window","<<Copy>>"]);
$popup_menu->add_command(-label => "Paste",-underline => 1
+,-command => [\&Tkx::event_generate,"$current_window","<<Paste>>"]);
print "window = $current_window\n";
$popup_menu->g_tk___popup($x,$y)
}
,Tkx::Ev('%X','%Y')
] );
}
|