afficher une mainwindow definie a partir dans un module
Bonjour,
Dans un programme perl test1.pl j'appelle une fonction : promptWindowCompare definie dans un module module1.pm
La fonction promptWindowCompare definit une fenetre graphique.
Mon probleme est que cette fenetre graphique n'apparait pas lorsque j'execute test1.pl
Je voudrais mettre la definition de cette fenetre promptWindowCompare dans le module car je la reutilise dans d'autres script perl
Merci pour votre aide.
Dans test1.pl
Code:
1 2
|
my $compareall = promptWindowCompare($sublf,$pgm); |
Dans module1.pm
Code:
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
|
sub promptWindowCompare {
my $subfile = shift;
my $pgm = shift;
my $text1 = "Export All Limits \n for limits.csv and all sublimits file(s)";
my $text2 = "Export Production screened parameters only \n for limits.csv and all sublimits file(s)";
if ($subfile eq "0")
{
$WindowComp = MainWindow->new( -title => 'Compare treatment for pgm '.$pgm.'');
}else
{
$WindowComp = MainWindow->new( -title => 'Compare treatment for pgm-subfile '.$pgm.'-'.$subfile.'');
}
$WindowComp->minsize('800','50');
$WindowComp->geometry('+100+300');
my $FrameComp = $WindowComp->Frame()->pack(-side=>'top');
## BUTTONS
my $ButtonCompAll = $FrameComp->Button(-text=> $text1,
-command=> \&DoCompareAll)
->pack(-side=>'left',-padx=>10);
my $ButtonCompProd = $FrameComp->Button(-text=> $text2,
-command=> \&DoCompareProd)
->pack( qw/ -padx 20 -pady 30 / );
MainLoop;
return $compareall;
} |