~ubuntu-branches/ubuntu/maverick/perl-tk/maverick

« back to all changes in this revision

Viewing changes to tcolour

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2010-05-30 09:19:40 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100530091940-wbmq9bloo92t9m6x
Tags: 1:804.029-1
* New Upstream Release (Closes: #578814).
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/local/bin/perl -w
2
 
 
3
 
use Tk;
4
 
 
5
 
my $mw = MainWindow->new;
6
 
 
7
 
my $t = $mw->Text(-background => 'yellow', -width => 30, -height => 10);
8
 
$t->pack(-expand => 1, -fill => 'both');
9
 
 
10
 
$t->insert('1.0','This is Text','Atag');
11
 
$t->tagConfigure('Atag',-background => 'green');
12
 
 
13
 
$mw->Button(-text => "Change Colour",
14
 
            -command => sub { $t->tagConfigure('Atag',-background => undef) }
15
 
           )->pack;
16
 
 
17
 
MainLoop;