#!/usr/bin/perl
use warnings;
use strict;
use Tk;
# a "phantom newline"-free copy'n'paste to
# the mouse clipboard
my $mw = tkinit;
my $textbox = $mw->Text(); #never packed
$mw->Button(-text =>'CLipAppend',
-command=>sub{
$textbox->clipboardClear;
$textbox->delete('1.0','end');
$textbox->insert('end','foobarz');
$textbox->selectAll;
#this next line must come after the selectAll
$textbox->delete('end - 1 chars','end');
$textbox->clipboardColumnCopy;
print chr(07); #beep
})->pack();
MainLoop;
perlmonks.org content © perlmonks.org and zentara
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03