in reply to
Ending an application gracefully
You are looking for
$main_window->OnDestroy( sub { ExitProgram() } );
You can register whatever exit function you need in the OnDestroy call. OnDestroy will be called when you end your application.
Comment on
Re: Ending an application gracefully
Download
Code
In Section
Seekers of Perl Wisdom