Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've been trying to paste what is in the clipboard (a word or a number) to entry widget in perl/Tk. I think I need to somehow bind this event to the right mouse click. Can you help me?.
  • Comment on How can I bind an event to right mouse click

Replies are listed 'Best First'.
Re: How can I bind an event to right mouse click
by Tanalis (Curate) on Oct 13, 2002 at 11:13 UTC
    A right-click bind in Tk is relatively simple to acheive:

    $object -> bind('<Button-3>', \&subToCall);

    If you're under Windows, then the Win32::Clipboard module should help you when it comes to pasting in text.

    More generally, Tk::Clipboard (which is built in, apparently, I haven't used it) can be used to copy and paste data within the application.

    Hope this helps ..
    --Foxcub