Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Tcl Online

#!/usr/bin/perl 
use warnings; 
use strict; 
use Tk;    # Appel du module Tk 
  
# Programme principal 
# Création de la fenêtre 
my $fenetre = new MainWindow( 
  -title      => 'Première fenêtre Tk', 
  -background => 'white', 
); 
  
# Taille minimale de ma fenêtre 
$fenetre->minsize( 300, 100 ); 
  
my $message_accueil = "Bonjour tout le monde\n\nWelcome dans le monde magnifique de Perl/Tk\n\n";

# Affichage d'un texte 
my $label_accueil = $fenetre->Label( 
  -text       => $message_accueil, 
  -background => 'white', 
)->pack(); 
  
# Affichage d'un bouton pour fermer la fenêtre 
my $bouton = $fenetre->Button( 
  -text    => 'Ferme la fenêtre', 
  -command => sub { exit; }, 
)->pack(); 
  
MainLoop;    # Obligatoire

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.