Controlling active window behaviour from script

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?

Thanks!

Andrew

Hi Andrew,

You can use:targetCanvas->cd(); // or targetPad->cd();

Cheers,
Philippe.

I think what you suggest will do the opposite of what I want: i.e. to make the active window the latest canvas/pad.

What I want to do is make the active window the console where the root script is running (i.e. none of the canvases or pads, just the text console)

Thanks!

Andrew

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);
        }

Hi,

There is nothing specific in ROOT to achieve this, and I don’t know how this could be done with X11…

Cheers, Bertrand.