herbert breunung wrote:
what to to if i start a program over this module and that program waits for 
input.
are there events to catch or even a way to feed that input.
# This is in the docs....
$process->WriteProcess( "blah\n" );

For example, I used it to control mpg123:

my $command = 'mpg123 -R';
$self->{mpg123process} = Wx::Perl::ProcessStream->OpenProcess($command, 'MPG123', $self);

# load and play mp3
$self->{mpg123process}->WriteProcess( "LOAD test.mp3\n" );

sub evt_process_stdout {
   my ($self, $event) = @_;
   $event->Skip(1);
   my $process = $event->GetProcess;
   my $line = $event->GetLine;
   # lots of processing of mpg123 STDOUT output...
}

sub OnQuitPlayer {
   my( $self, $event ) = @_;
   $self->{mpg123process}->WriteProcess( "Q\n" );
}

Hope it helps,

Cheers,
Huub Peters

Reply via email to