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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| #!/usr/bin/perl
use warnings;
use strict;
use utf8;
use Tk;
use Tk::LabFrame;
my $fen = MainWindow->new;
my $width = $fen->screenwidth();
my $height = $fen->screenheight();
$fen->destroy();
# Creation du widget principal
my $Wm = MainWindow->new(
-width => $width,
-height => $height,
-background => 'white',
);
$width = $Wm->screenwidth*(1/5);
$height = $Wm->screenheight*(1/5);
$Wm->configure(-height=>$height, -width=>$width, -title=>"Ormelune");
$Wm->geometry( $width ."x". $height );
$Wm->MoveToplevelWindow (100,100);
#$Wm->overrideredirect(1); Pour supprimer cadre Windows avec ses boutons
#$Wm->packPropagate(0);
#$Wm->raise();
# Cadre des configurations
my $couleur_commune = '#E0F0FF';
my $cadre_configuration_playlist = $Wm->Frame( -background => $couleur_commune, );
# Cadre Gestion
my $cadre_gestion = $Wm->LabFrame(
-label => 'Gestion',
-background => $couleur_commune,
-font => '{Simplified Arabic} 10 {bold}',
);
my $Scale = $cadre_gestion->Scale(
-background => $couleur_commune,
-orient => 'h', -digit=>1,
-length => 100,
-from => 1, -to => 1000,
-variable => \$width,
);
####################################
# Gestion de l'affichage des widgets
#
$cadre_gestion->pack(qw / -side right -fill both -expand 1 /);
$Scale->grid(
qw / -padx 2 -pady 5 -sticky nsew /
);
sub ModifWidth {
$Wm->configure(-width=>$width);
$Wm->geometry( $width ."x". $height );
}
$Scale->bind('<ButtonRelease-1>',[\&ModifWidth]);
MainLoop; |
Partager