in reply to Catching WINDOW close event and take actions
If you are just running an xterm , I don't know if it's possible easily. You probably would have to incorporate Term::ReadKey into your script and manually filter the keys.#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow; $mw->title("Close test"); $mw->geometry("400x250"); #prevents mw from closing $mw->protocol('WM_DELETE_WINDOW' => sub { print "do stuff here before the exit\n"; exit; }); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Catching WINDOW close event and take actions
by Anonymous Monk on Sep 15, 2011 at 21:31 UTC | |
|
Re^2: Catching CTRL+ALT+DEL close event and take actions
by Anonymous Monk on Sep 21, 2011 at 23:53 UTC | |
by zentara (Cardinal) on Sep 22, 2011 at 09:23 UTC | |
by Anonymous Monk on Sep 22, 2011 at 10:05 UTC |