http://www.perlmonks.org?node_id=539643


in reply to 'system' hangs in a Windows Tk app

I happen to do almost exactly what you ask - I place a button on Tk and when user presses it, I invoke VIM.

In order to achieve this, you need

Win32::Process::Create($pobj, "$args[0]", "@args", 0, NORMAL_PRIORITY_CLASS, ".") || die "can't Win32::Process::Create: (\@args=[@args])". Win32::F +ormatMessage(Win32::GetLastError());
See proper documentation.

Also, using Tcl::Tk as a replacement to perlTk will give you many advantages.

Best regards,
Courage, the Cowardly Dog

Replies are listed 'Best First'.
Re^2: 'system' hangs in a Windows Tk app
by ff (Hermit) on Mar 28, 2006 at 13:43 UTC
    Thanks, Courage. Several other notes seem to pity users of system but they don't say what to do about it. I tried your method and my process does not get hung. There appear to be many interesting controls for Win32::Process and I will examine some other places in my code where I'm not satisfied with how system behaves.

    In this particular case, I have opened a bug report and find that my problem is similar to another recently submitted bug and ActiveState is working on it. (?)

    As for an alternative to Tk, people have said that my interface looks old-fashioned, 80's-ish, etc., and I wouldn't mind an alternative, but I'm pretty invested and will need to gain traction with my app before I can afford to make any big changes. :-)

      Tk could be considered old-fashioned, but:
      • its Text and Canvas are very powerful, and this could outweight many drawbacks
      • Tk has Tile, see how it could be used http://vkonovalov.ru/cgi-bin/perl-tcltk-wiki.cgi/41
      • I did not adviced you to switch from Tk to an alternative, I just adviced to use Tk differently and more effectively.

      On another point, if "old-fashioned" Tk is denied by end-users of software, you can actually use *any* GUI toolkit from Perl.
      I, for one, started from using Perl from within C++Builder GUI, but then, step by step, I switched to something more powerful.