added and documented wxProcess::Open()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,13 +47,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent)
|
||||
// wxProcess creation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxProcess::Init(wxEvtHandler *parent, int id, bool redirect)
|
||||
void wxProcess::Init(wxEvtHandler *parent, int id, int flags)
|
||||
{
|
||||
if ( parent )
|
||||
SetNextHandler(parent);
|
||||
|
||||
m_id = id;
|
||||
m_redirect = redirect;
|
||||
m_redirect = (flags & wxPROCESS_REDIRECT) != 0;
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
m_inputStream = NULL;
|
||||
@@ -62,6 +62,20 @@ void wxProcess::Init(wxEvtHandler *parent, int id, bool redirect)
|
||||
#endif // wxUSE_STREAMS
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxProcess *wxProcess::Open(const wxString& cmd)
|
||||
{
|
||||
wxProcess *process = new wxProcess(wxPROCESS_REDIRECT);
|
||||
if ( !wxExecute(cmd, wxEXEC_ASYNC, process) )
|
||||
{
|
||||
// couldn't launch the process
|
||||
delete process;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return process;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxProcess termination
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user