I have several simple Perl programs writing to the standard output, but this has some problems:
- some of my users are scared by a console
- my users work on Windows, so my program output is displayed on a
cmdconsole, so I cannot control the way it is displayed (colors and terminal size), and worse, the console is not resizeable (at least in width)
To solve these problems, I would like to be able to display the output in a simple GUI interface as an option. The GUI should be responsive until the program finishes (it should be possible to scroll or resize the window while it’s running).
What simple toolkit and widget can I use to do this? (I develop on Windows with ActivePerl).
You can use any GUI option you like, and then you could use Tie::STDOUT to redefine the behavior of
printandprintfto the STDOUT filehandle to instead dump output into the widget of your choice. The only thing is that getting it to talk to your widgets across packages cleanly using the anonymous sub might be messy. Here’s a short, crude example using Win32::GUI:Note the call to
Win32::GUI::Dialog()at the end is present to keep the window from closing as soon as the script is finished.