Newbie :How do i make the mainwindow close... 
Author Message
 Newbie :How do i make the mainwindow close...

hi,

When I clickOK I need to close the main window ...how do i do that..

Chhil

my $top = MainWindow->new;
my $f = $top->LabFrame(-label => "Parameters", -labelside => "acrosstop");
my $b1 = $top->Button(-text => " OK ", -command => \&OK);
my $b2= $top->Button(-text => "Cancel", -command => \&Cancel);

$f->LabEntry(-label => "UNCName", -textvariable => \$uncname)->pack;
$f->LabEntry( -label => "Sharename", -textvariable =>\$sharename)->pack;

$f->pack;

$b1->pack(-ipadx =>10,-ipady=>5,-side =>left,padx =>10,pady=>10);
$b2->pack(-ipadx =>10,-ipady=>5,-side =>right,padx =>10,pady=>10);

MainLoop;
sub OK
{ #if the value "UNCname is not there set it.
Win32API::Registry::RegSetValueEx($handle,$cszUNCNameKey,0,REG_SZ,$uncname,0
) or $i= 0;

if ($i == 0)

{

print "Could not create value";

Quote:
}

Win32API::Registry::RegSetValueEx($handle,$cszShareNameKey,0,REG_SZ,$sharena
me,0) or $i= 0;

if ($i == 0)

{

print "Could not create value";

Quote:
}
}

sub Cancel
{
print "Registry keys not set ..Exit";
Quote:
}



Tue, 10 Jul 2001 03:00:00 GMT  
 Newbie :How do i make the mainwindow close...

Quote:

> hi,

> When I clickOK I need to close the main window ...how do i do that..

        $top->destroy

--
use Tk;$c=tkinit->Canvas->pack;$x=45;for(split/_/,'KPI1_+09IPK_K;-OA1_+K!;A__1;
Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+KN._K+1Q!.F_1+KN.Q_+1Q__+1!
KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q'){s/\n//g;for(split/!/){$c->create(
'line',map{$a=-43+ord;($x+($a>>3)*2,123+($a&7)*2)}split//)}$x+=12}MainLoop



Wed, 11 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Close all MainWindows + cleanup per MainWindow

2. Closing a pipeline before the command is done

3. MainWindow always uses geometry from last MainWindow

4. making a tree open with closed branches

5. Newbie: what the code is doing?

6. Newbie question: load page after script is done

7. Perl Newbie - can this be done?

8. newbie: what am i doing wrong?

9. Newbie- Close error - Bad File Number

10. newbie trying to close off a pipe

11. NEWBIE: Problem with making perl modules

12. newbie needs help making DBI module

 

 
Powered by phpBB® Forum Software