Jeremy White wrote:
Something like this:
- ability to close Console if there is one present and its not needed
- automatically re-create a console window if any reads/writes are
done on stdin/out/err
- ability to set the Console window title, Icon etc.
Eventually remove GetPerlWindow() from GUI.xs??
I suspect I'm missing the point:) But why do any of this? During
development most people would run with the console window showing -
makes debugging a GUI app so much simpler. Then when the script needs to
be deployed (either by wperl, or one of the exe creators) - the console
is automatically not created?
Good question that set me off thinking. The initial though was spurred
by not wanting to have to re-write all the demos so that they could be
launched without consoles, but still have one when needed. Having
thought further, I think I can make a case for it:
(1) You're right about how you and I (and others) would probably develop
apps, but I'm pretty sure that most people don't package their perl
scripts as executables. It would be nice for these people to have
something more powerful than
Win32::GUI::Hide(Win32::GUI::GetPerlWindow());
that wouldn't hide the console if started from the command line, and
didn't launch a console when double clicking the .pl script, unless the
script produces some output.
(2) If I use other peoples modules in my apps, then I don't know what
errors will be produced to stdout/stderr, and I'd get better bug reports
if people could see something, rather than the app silently terminating.
I'm going to have a go at this, as I think it's a pretty simple wrapper
round Win32::Console. Then we'll see what people think (besides, I
think I need something to complete the win32-gui-demos.pl script)
Regards,
Rob.