Hi,
If its a gui loft window _Terminate (clicking X)will return -1 by default,
thus destroying your window object. override it by adding return 0; to the
Window2 _Terminate sub
eg
 sub Window2_Terminate {
     $Window2->Hide();
        return 0;
 }


JohnR

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 11 April 2002 10:08
> To: perl-win32-gui-users@lists.sourceforge.net
> Subject: [perl-win32-gui-users] terminating popup window
> 
> 
> hi. i've got a weird problem with my popup window. if i close it by
> clicking on the x the window closes fine but if i click on 
> the button to
> open it again, it won't open. however if i click on save and 
> exit in the
> popup window, when i click on the button the open the window 
> again it works
> fine. any ideas?
> 
> this is for the popup window:
> 
> sub Settings_Click {
>     open SETTINGS, "settings.dat";
>     while (<SETTINGS>) {
>      ($list_dun,$store_entry) = split /,/;
>     }
>     $Window2->DunBox->Change(-text => $list_dun);
>     $Window2->StoreField->Change(-text => $store_entry);
>     close SETTINGS;
> 
>     $Window2->Show();
> }
> 
> this is for the button in the window:
> 
> sub SaveAndExit_Click {
>     open SETTINGS, ">settings.dat";
>     $dun_list = $Window2->DunBox->Text();
>     $store_entry = $Window2->StoreField->Text();
>     print SETTINGS "$dun_list,$store_entry";
>     close SETTINGS;
>     $Window2->Hide();
> }
> 
> and then.....
> 
> sub Window2_Terminate {
>     $Window2->Hide();
> }
> 
> 
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> 

Reply via email to