1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| use Tk;
use Tk::LabFrame;
use Tk::BrowseEntry;
use warnings;
use strict;
use locale;
use LWP::Simple;
#la fenetre principale du projet
my $main = MainWindow->new( -title => 'Extraction D Information A Partir Du Web');
$main->minsize( 860,600 );
#insertion d'un frame
my $frame1 = $main->LabFrame(-label => "Exemple d'affichage du code html",-background => 'gray',)->pack( qw/ -fill both -expand 1/ );
#insertion d'un label de l url
my $label = $frame1->Label( -text => 'Saisir une url ici :',
)->place( -x => 5, -y => 30);
#insertion d'une zonde de saisie pour l'url
my $url;
my $zone_url = $frame1->BrowseEntry(-variable =>\$url,
-width => 30,
)->place( -x => 85, -y => 30);
#insertion des 2 url comme exemples dans la liste url
$zone_url->insert('end','http://www.isi.edu/info-agents/RISE/LAW/cuban.law.html');
$zone_url->insert('end','http://www.isi.edu/info-agents/RISE/Zagat/apple_pan.html');
#insertion des bouttons
my $afficher = $frame1->Button( -text => 'Afficher_code_html', -background =>"grey" ,-borderwidth => 5,-relief => 'raised',-foreground =>"blue" ,-font => '{Garamond} 10',
-command => sub {my $texte1 = $frame1->Scrolled('Text',-scrollbars => 'osoe',-background => '#F3EFFF',)
->place( -x => 600, -y =>10 );my $codehtml = get($url);$texte1->insert("end",$codehtml);},)->place(-x => 5, -y => 60);
my $quitter = $frame1->Button( -text => ' Quitter ', -background =>"grey" ,-borderwidth => 5,-relief => 'raised',-foreground =>"blue" ,-font => '{Garamond} 10',
-command => sub {$main->destroy;},)->place(-x => 125, -y => 60);
MainLoop; |
Partager