1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
use Tk ;
sub affichage
{
$affiche = $texte -> get ( '1.0' , 'end' ) ;
}
sub QuitterApplication
{
exit ( 0 ) ;
}
$fenetre = new MainWindow ( ) ;
$fenetre -> title ( 'widget Text' ) ;
$texte = $fenetre -> Text ( -width => 20 , -height => 5 ) ;
$texte -> pack ( ) ;
$fenetre -> Label ( -textvariable => \$affiche )-> pack ( ) ;
$fenetre -> Button ( -text => 'afficher' , -command => \&affichage )-> pack ( ) ;
$bouton = $fenetre -> Button ( -text => 'Quitter' , -command => \&QuitterApplication ) ;
$bouton -> pack ( ) ;
MainLoop ( ) ; |