Search code examples
perluser-interfacepopupprogress-barprogress

File copy progress popup in Perl without using Tk?


I recently came across a Perl script that copies a large number of files and creates a popup window showing the progress of the files being copied.

The progress bar looks like this:

Progress bar

(The Title, folder name and file names are blocked out because these are files for work and I don't know if I am allowed to release that information)

This script is being run on a server that has a standard Perl install v5.18.2 with no added modules It does not have Tk installed (along with many other useful modules i might add...)

The script that is generating this box is incredibly over complicated and very difficult to follow... I traced the copy down to a series of xcopy commands in a loop but there was nothing to indicate the creation of the popup progress meter. I don't even see any indication that the script is calling an external application in order to generate this progress meter.

Is there a way to make a progress bar like the one shown above in Perl without using Tk?

If not, what kind of external application would the script be calling to make this kind of progress bar?


Solution

  • It turns out that this progress bar was being created outside the Perl script by another application, It took me a long time to track down but I found the source. It is being generated by a .exe file that is binary encoded so there is no way I can get any information out of it.

    This answers what was happening in my particular situation, but it does not answer the question of how to create a popup like this. If there is a way that Perl can create a popup window like this without delving into Tk it would really be useful for me since I do not have access to Tk where I work.


    EDIT:

    It turns out that Perl comes standard with a module called Tkx that can do everything the Tk module can! I was able to make a progress bar after delving into the Tkx tutorial.