1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| #!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $fenetre = new MainWindow(
-title => 'Première fenêtre Tk',
-background => 'white',
);
my $choice;
my $entryText = $fenetre->Entry(
-width => 20,
-background => 'white',
-validate => "key",
-takefocus => 1,
-validatecommand => sub {
my ($valeur_entry, $caractere_ajoute, $valeur_courante_avant_validate, $index, $type_action) = @_;
print "TEXTE : $valeur_entry, $caractere_ajoute, $valeur_courante_avant_validate, $index, $type_action\n";
},
)->pack( );
$entryText->focus; |
Partager