For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > January 2005 > perl/tk paste?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author perl/tk paste?
imahacker@the-pentagon.com

2005-01-17, 3:58 pm

hi, perl/tk newb. i've been doing great with this but ran into a
little problem. i have several entry widgets, and i want to be able to
cut/paste between them. kbd shortcuts work, but i want a right-click
menu. i have the mouse button binded, copy works fine, i do it like
so:

sub copy{
$ctc = $mw->SelectionGet();
$CLIP->Set("$ctc");
$statusbar = "copied: $ctc";
}

whats the trick to paste? the function works, the following will put
my text into the variable pfc, but how do you actually make it display
on the gui? (note: not the dos window in the background.) i thought i
was on the right track with the insert command, but you have to have
the entry widget name (of course.) is there a way to make it insert
the $pfc where the cursor is currently on the gui app?

sub paste{
$pfc = $CLIP->GetText;
print "$pfc";
}

any pointers in the right direction will be appreciated.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com