You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
906 B
Perl

#!/usr/local/bin/perl -w
use Tk;
use strict;
my $mw = MainWindow->new;
my $t = $mw->Scrolled('Text')->pack(-fill => 'both', -expand => 1);
$t->insert('end', "test");
$t->markSet('one', '1.3');
$mw->Button(-text =>'left',
-command => sub {
$t->markGravity('one', 'left');
$t->insert('one', '***');
}
)->pack(-side => 'left');
$mw->Button(-text =>'right',
-command => sub {
$t->markGravity('one', 'right');
$t->insert('one', '***');
}
)->pack(-side => 'left');
$mw->Button(-text => "Report",
-command => sub {
my @m = $t->markNames();
foreach (@m) {
print "MARK: $_ at ", $t->index($_), "\n";
}
}
)->pack(-side => 'left');
MainLoop;