1. wxShell fixes: now really uses shell (it wasn't different from wxExecute!)
and also added a version which captures the programs output 2. fix for compilers which have void ftime() (my mingw does) in timercmn.cpp 3. updated console sample to test wxShell/wxExecute 4. treetest now can toggle images or change their size 5. wxTreeCtrl doesn't crash if it has no image list git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -205,15 +205,37 @@ long wxExecute( const wxString& command, bool sync, wxProcess *process )
|
||||
return lRc;
|
||||
}
|
||||
|
||||
bool wxShell(const wxString& command)
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxShell
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static wxString wxMakeShellCommand(const wxString& command)
|
||||
{
|
||||
wxString cmd;
|
||||
if ( !command )
|
||||
{
|
||||
// just an interactive shell
|
||||
cmd = _T("xterm");
|
||||
}
|
||||
else
|
||||
cmd = command;
|
||||
{
|
||||
// execute command in a shell
|
||||
cmd << _T("/bin/sh -c '") << command << _T('\'');
|
||||
}
|
||||
|
||||
return wxExecute(cmd) != 0;
|
||||
return cmd;
|
||||
}
|
||||
|
||||
bool wxShell(const wxString& command)
|
||||
{
|
||||
return wxExecute(wxMakeShellCommand(command), TRUE /* sync */) == 0;
|
||||
}
|
||||
|
||||
bool wxShell(const wxString& command, wxArrayString& output)
|
||||
{
|
||||
wxCHECK_MSG( !!command, FALSE, _T("can't exec shell non interactively") );
|
||||
|
||||
return wxExecute(wxMakeShellCommand(command), output);
|
||||
}
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
Reference in New Issue
Block a user