in reply to killing a child process which contains a Tk Main window

I'm trying to launch a tk dialog box to tell the user to wait until what i'm processing is done. To do this i'm forking the main program.

... that is about as wrong a thing you can do with a gui toolkit..... you cannot go outside of the main process with any Tk widget...... you need to rethink your design...... unless all your Tk is contained in the forked code

...the problem is that Tk and almost gui's are event loop systems...... you cannot track a loop from one process to another, unless you use InterProcess Communication.....read perldoc perlipc

.... write down what exactly you need done.....there are ways of doing what you want, but you are doing it backasswards

...then maybe someone will show you an example for Tk ipc on windows....like Tk GUI and Listen?

... in general: see tk-ps ..... you let Tk exist in the master loop, and spawn your process off thru an IPC.... you let the spawned program terminate and return to the Tk program, which holds your popup notification

on windows you probably want something like IPC::Run or another windows friendly ipc module

PS .. a few hours later..... there is another tip i will give you..... only create 1 mainwindow in any one program..... and use toplevels for everything else..... here is an idea for you

#!/usr/bin/perl -w use strict; use warnings; use Tk; my $mw = MainWindow->new(); $mw->withdraw(); my $ftp_warn = $mw->messageBox( -title => 'Silly message', -message => "We are displaying a silly message, do you wish to conti +nue?", -type => 'YesNo', -icon => 'question', ); if ( $ftp_warn eq 'No' ) { exit; }else { my $msg2 = $mw->messageBox( -title => 'Really?', -message => "We displayed silly message and you wish to continue?" +, -type => 'OK', -icon => 'question', ); while (1){ print "hit control-c to exit\n"; sleep 1; } }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku