Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanksuse Tk ':variables'; ... # It handles right-clicks on all entries of the main window $mwindow->bind("Tk::Entry", "<Button-3>", sub {$popup->Popup( -popover => "cursor", -popanchor => 'nw' )} ); # It makes the menu row 'Copy' and calls the sub callback my $popup = $mwindow->Menu( -tearoff => 0, -menuitems => [ ['command' => "~Copy", -command => \&callback] ] ); # It must copy the content of the event's entry to the clipboard, but. +.. sub callback { my $f = $Tk::event->ENTRY; # what instead of ENTRY? which method? +(A, B...) my $g = $f->get(); $mw->clipboardAppend($g); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl-Tk, how to call the event object (entry)
by lamprecht (Friar) on Aug 09, 2009 at 21:17 UTC | |
by Anonymous Monk on Aug 10, 2009 at 05:25 UTC |