Thread Befehl solange ausführen wie button gedrückt (10 answers)
Opened by popcorn5 at 2005-11-02 11:39

Crian
 2005-11-08 18:37
#44851 #44851
User since
2003-08-04
5873 Artikel
ModeratorIn
[Homepage]
user image
schick... sonst so:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Tk;

my $mw = new MainWindow;

my $b = $mw->Button(-text => 'Run')->pack(-fill => 'x');

my $id;
my $i;

$b->bind('<ButtonPress-1>' => sub { $i = 0;
$id = $mw->repeat(2, sub {print ++$i, "\n"}) } );
$b->bind('<ButtonRelease-1>' => sub { $id->cancel() } );

MainLoop();
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite

View full thread Befehl solange ausführen wie button gedrückt