September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1,11 +1,27 @@
|
|||
use XUL::Gui;
|
||||
use Tk;
|
||||
use Time::HiRes qw(sleep);
|
||||
|
||||
my $dir = '(.+)(.)';
|
||||
interval {
|
||||
ID(lbl)->value =~ s/$dir/$2$1/;
|
||||
} 75;
|
||||
my $msg = 'Hello World! ';
|
||||
my $first = '.+';
|
||||
my $second = '.';
|
||||
|
||||
display Label
|
||||
id => 'lbl',
|
||||
value => "Hello World! ",
|
||||
onclick => sub {toggle $dir => '(.+)(.)', '(.)(.+)'};
|
||||
my $mw = Tk::MainWindow->new(-title => 'Animated side-scroller',-bg=>"white");
|
||||
$mw->geometry ("400x150+0+0");
|
||||
|
||||
$mw->optionAdd('*Label.font', 'Courier 24 bold' );
|
||||
|
||||
my $scroller = $mw->Label(-text => "$msg")->grid(-row=>0,-column=>0);
|
||||
$mw->bind('all'=> '<Key-Escape>' => sub {exit;});
|
||||
$mw->bind("<Button>" => sub { ($second,$first) = ($first,$second) });
|
||||
|
||||
$scroller->after(1, \&display );
|
||||
MainLoop;
|
||||
|
||||
sub display {
|
||||
while () {
|
||||
sleep 0.25;
|
||||
$msg =~ s/($first)($second)/$2$1/;
|
||||
$scroller->configure(-text=>"$msg");
|
||||
$mw->update();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue