I wonder how to add a simple, slightly GUI-like feeling to a command
line application.
If I distribute a script that should be execute on the linux command
line no one is surprised.
When I give the same script to a windows user in many cases he will be
afraid of the
"black DOS window".
So I think I would like to use Wx and open a real window that will behave
as if I ran my script already on the command line.
So here is what I think, I try to make it as clear as I can at this hour....
Create a Wx module that will allow the user to ceate a simple GUI for
his command-linish
application.
The user can type in something in the last line, edit the last line and once
the user presses ENTER the string in the last line is sent to the application.
The application can print to the widget line after line.
The code should then look something like this:
use Module;
Module->setup;
# This would open a window with a textbox or similar
# and connect STDOUT, STDERR and STDIN to the same textbox
print "Your name:"; # goes to the widget
my $name = <STDIN>; # reads one line from the widget
warn("something wrong"); # goes to the widget
I am not sure if it is a really good idea to connect the STDs to my application.
Maybe it would be better to have this code:
use Module;
my ($in, $out, $err) = Module->setup;
# This would open a window with a textbox or similar
# and connect STDOUT, STDERR and STDIN to the same textbox
print $out "Your name:"; # goes to the widget
my $name = <$in>; # reads one line from the widget
print $err "something wrong"; # goes to the widget
# and maybe connect $SIG{__WARN__} to $err as well.
I can imagine that maybe instead of one window there will be 2 or 3
separating the windows of STDOUT, STDERR and STDIN but that's an enhancement.
I don't think this should be too difficult to write but I wonder if
there is such a thing already?
If not in which name space should I upload it?
Is there a name space designated for add-on Wx widgets?
regards
Gabor