So it's hard to say from your limited code example, but you are probably running into a situation where system is blocking the Tk event loop. Tk (and all GUI's) run a thing called the event loop..... your new MainWindow; and MainLoop; statements are what start it. Once MainLoop gets called, a big loop starts running behind the scenes, doing everything you ask, on a schedule. When you put a while(1) loop in Tk, or a system call, it will hog the whole loop until it finishes (system returns).
So...... you want to avoid system calls, unless they are in a piped open or somehow forked off. Since you are writing the results to an output file ( not collecting the results internally), you can fork off the system call, and let Tk keep running it's loop. So instead of system, fork and exec. Like:
I don't use windows, so there may be some special syntax you need to exec your command. See how to create independent process? and Perl Tk: opening a file in its original format for more ideas.if(fork() == 0){ exec( "$executable $title" ) }
In reply to Re: Tk - system()
by zentara
in thread Tk - system()
by lil_v
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |