In my aclic script, I create a number of canvases. Each new canvas changes the X11 (opensuse linux) active window from the console to the Canvas window. To get back to the root console to input some parameters, I have to change the active window (e.g. with mouse).
How can I control this in my script to avoid unnecessary active window changes?
here is the relevant snippet of code. I added the line you suggested to try to avoid the user having to click back from the canvas b1 to the console.
bool happy = 0;
bool valid = 1;
TFitResultPtr fitres;
while (!happy) {
// Perform the baseline FIT
if (valid) {
curscan->Fit(btitle);
fitres = curscan->Fit(btitle,"QSr");
b1->Update();
}
b1->cd(); // we don't want this to be the active window
char isok;
cout << " Are you happy with this fit? (y/n):";
cin >> isok;
valid = (isok=='y'||isok=='n');
if (!valid) cout << " Invalid response!\n";
happy = (isok=='y');
char go;
if (!happy) {
cout << " Refit, Set or Fix zero curvature (r/s/f): ";
cin >> go;
}
if (go=='s') basel->SetParameter(2,0.0);
if (go=='f') basel->FixParameter(2,0.0);
}