tried the sigaction but it doesn't work
in bloody M$ windows, so i can't use it :(
and it also seems that liz was right, $SIG{blaa}
won't do it , at least not in that example

 help ?


-- program now
# i thought that this may work
# but it does not
# did i make a mistake somewhere
# or doesn't it just work that way?

use strict;
use Tk;
use threads;
use threads::shared;
use POSIX;

# for debugging 
$|=1;


sub change_title {
        print "change title called !!!\n\n\n";
}

# constructing a new window
my $mw = new MainWindow('title'=>"Tiitel");

#starting the other thread
# which should change our title
print "setting up sig trap\n";

$SIG{INT} = \&change_title;

print "calling thread to alter title \n";
my $a = getpid();
print "my pid is $a \n";
threads->create("alter_title",$a);

# this loops the tk events and refreshes 
# the window inner things like buttons etc.
# it blocks until the window is closed
MainLoop;

sub alter_title {
        print "altering title \n";
        my $pid = pop @_;
        print "killing pid is $a \n";
        kill SIGINT, $pid;      
        print "killing pid $a done\n";
}


Reply via email to