Hello Tom,
TString pathtmp = Form("%s/anyfile", gSystem->TempDirectory());
// redirect stdout/stderr to temp file
if (gSystem->RedirectOutput(pathtmp.Data(), opt) != 0) {
Error("ShowStatus", "stdout/stderr redirection failed; skipping");
}
// execute command line
gApplication->ProcessLine(cmd);
// restore back stdout/stderr
if (gSystem->RedirectOutput(0) != 0) {
Error("ShowStatus", "stdout/stderr retore failed; skipping");
}
// if check box "clear view" is checked, clear text view
if (fClearCheck->IsOn())
fInfoTextView->Clear();
// load (display) temp file in text view
fInfoTextView->LoadFile(pathtmp.Data());
2) There is no simple solution...
Plese take a look at the attached file (KillProcByName), it may help (it
is pure Win32 code).
3) To hide the command prompt on Windows, please take a look at this
page:
http://root.cern.ch/root/HowtoWindows.html
Cheers,
Bertrand.
-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch
[mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Tom Roberts
Sent: Monday, January 22, 2007 12:16 AM
To: roottalk_at_pcroot.cern.ch
Subject: Re: [ROOT] Inquiry about portable GUI and scripting
I have spent an hour or two playing with this, and have a reasonable first attempt. It has a TGTextEntry to enter a command, a Run button, and uses a TThread to copy stdout of the command to a TGTextView -- that is most of what I need. Eventually I'll make it find my executable and setup its environment (what I need the portable scripting to do).
Two limitations:
And a question: Is there a way to suppress or hide the stdin/stdout/terminalWindow of Root? It is likely to confuse some users....
Tom Roberts Received on Mon Jan 22 2007 - 09:20:10 CET
This archive was generated by hypermail 2.2.0 : Mon Jan 22 2007 - 17:50:00 CET