windows - How can I show Perl console output in a GUI? -
I have several simple pell programs to write on standard output, but there are some problems:
- My users work on Windows, so my program output is displayed on the
cmd
console, so I can not control the way I control it (colors and colors) Terminal size), and this Worse, the size of the console is not changeable (at least width)
Li> Some of my users are scared by the console
To solve these problems, I get an output as an option until the end of the simple GUI interface program The GUI should be responsive (it is possible to scroll or shape the window while it is running).
What simple toolkit and widget can I use to do this? (I develop on Windows with ActivePerl).
You can use any of your preferred GUI options, and then you can add a widget Instead of dumping the output into STDOOT fileshield, the only thing that can be used to redefine the behavior of print
and printf
is that it is secretly Talking with your widgets in packages that use anonymous sub can be messy. Here's a brief, raw example:
Use Win32: GUI; Use Tie: STDOUT print => Sub {$ main :: textfile-> Attachments (@_); }; My $ main = win32 :: GUI :: window-> New (-name = & gt; 'main', -text = & gt; 'pearl', method => 220, -height => 230,); Our $ textfield = $ master-> AddTextfield (-name = & gt; "Output", -left = & gt; 8, -top => 8, -width => 180, -height => 180, -Dedney = = Gt; 1, -multiline => 1, -vscroll => 1,); $ Main- & gt; Show (); Deputy Chief-Gearmate {-1; } If (Fork ()) {Print "Hello. \ N"; For (1.20) {sleep 1; Printf "more output% d \ n", $ _; }} Else {Win32 :: GUI :: dialog (); } Call
call to win32 :: GUI :: dialog ()
, as the script ends when the window is closed to close it.
Comments
Post a Comment