+void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event))
+{
+ if ( !m_cmdLast )
+ m_cmdLast = _T("tr [a-z] [A-Z]");
+
+ wxString cmd = wxGetTextFromUser(_T("Enter the command: "),
+ DIALOG_TITLE,
+ m_cmdLast);
+
+ if ( !cmd )
+ return;
+
+ wxString input = wxGetTextFromUser(_T("Enter the string to send to it: "),
+ DIALOG_TITLE);
+ if ( !input )
+ return;
+
+ // always execute the filter asynchronously
+ MyPipedProcess2 *process = new MyPipedProcess2(this, cmd, input);
+ int pid = wxExecute(cmd, FALSE /* async */, process);
+ if ( pid )
+ {
+ wxLogStatus(_T("Process %ld (%s) launched."), pid, cmd.c_str());
+
+ m_running.Add(process);
+ }
+ else
+ {
+ wxLogError(_T("Execution of '%s' failed."), cmd.c_str());
+
+ delete process;
+ }
+
+ m_cmdLast = cmd;
+}
+
+void MyFrame::OnFileExec(wxCommandEvent& event)