MoshiachNow
IS-IT--Management
HI,
I need to create 2 dialogs.Both should start or not depending on some conditions - respectively
If none conditions are matched - I do not need any of them started,and the application to run without popping up any window.
Did not manage to achieve it with current code:
unless ( -f "$INSTPATH\\company.txt" || $company) { #only if the file does not exist
$mw = MainWindow->new;
$mw->withdraw;
$guimode = "YES";
#$mw->withdraw;
$frm1=$mw->Frame(-relief=>'groove',-borderwidth=>3,-background=>'blue')->pack(-side=>'top',-fill=>'x'); #the password part
my $compwin = $frm1->Toplevel(-width =>55,-title => 'Enter company name');
$company = '';
$compwin->Label(-text => 'Enter company name')->pack(-side=>'top');
$compwin->bind('<Return>'=>sub{&start});
$compwin->focus(-force);
my $compentry = $compwin->Entry (-width =>35,-background=>'white',-textvariable =>\$company)->pack(-side=>'left',-pady=>3);
my $submitBttn = $compwin->Button (-text => 'OK',-command =>sub{&start})->pack(-side=>'right',-pady=>3);
$compentry->focus(-force);
#$compentry->focus(-force); $dialog1->Show;
} else {
$mw = MainWindow->new;
$mw->withdraw;
$dialog2 = $mw->DialogBox (-title => 'ZIP file creation has failed !!!',-buttons => [ 'YES', 'No' ], #define the final dialog
-default_button => 'OK');
$dialog2->add ('Label', -text => 'ZIP file creation has failed !!!',-font =>'Arial 14 bold' ,-foreground => 'red')->pack;
&start;
}
MainLoop ;
.
.
.
if ($zip->read( $ZIPNAME ) != AZ_OK) {
$dialog2->Show;
}
Long live king Moshiach !
I need to create 2 dialogs.Both should start or not depending on some conditions - respectively
If none conditions are matched - I do not need any of them started,and the application to run without popping up any window.
Did not manage to achieve it with current code:
unless ( -f "$INSTPATH\\company.txt" || $company) { #only if the file does not exist
$mw = MainWindow->new;
$mw->withdraw;
$guimode = "YES";
#$mw->withdraw;
$frm1=$mw->Frame(-relief=>'groove',-borderwidth=>3,-background=>'blue')->pack(-side=>'top',-fill=>'x'); #the password part
my $compwin = $frm1->Toplevel(-width =>55,-title => 'Enter company name');
$company = '';
$compwin->Label(-text => 'Enter company name')->pack(-side=>'top');
$compwin->bind('<Return>'=>sub{&start});
$compwin->focus(-force);
my $compentry = $compwin->Entry (-width =>35,-background=>'white',-textvariable =>\$company)->pack(-side=>'left',-pady=>3);
my $submitBttn = $compwin->Button (-text => 'OK',-command =>sub{&start})->pack(-side=>'right',-pady=>3);
$compentry->focus(-force);
#$compentry->focus(-force); $dialog1->Show;
} else {
$mw = MainWindow->new;
$mw->withdraw;
$dialog2 = $mw->DialogBox (-title => 'ZIP file creation has failed !!!',-buttons => [ 'YES', 'No' ], #define the final dialog
-default_button => 'OK');
$dialog2->add ('Label', -text => 'ZIP file creation has failed !!!',-font =>'Arial 14 bold' ,-foreground => 'red')->pack;
&start;
}
MainLoop ;
.
.
.
if ($zip->read( $ZIPNAME ) != AZ_OK) {
$dialog2->Show;
}
Long live king Moshiach !