TCanvas container window control

Hi,
I need to control the window that contains a TCanvas. After the creation of a TCanvas, I need to

  • move the container window in a different position into the screen
  • resize the container window (not the contained canvas)
  • move the window in front of all the windows of the desktop: I need to select the canvas from a list of created canvases and put the container window in front of all the windows.

Thank you very much
Best regards
Andrea Bulgarelli

Hi Andrea,

Once you have a TCanvas created you can use:
canvas->SetWindowPosition(Int_t x, Int_t y);
canvas->SetWindowSize(UInt_t ww, UInt_t wh);

To move it in front of all windows you will need something else. It seems we have not this possibility using the canvas pointer right now but I will check that and provide the necessary changes in cvs if needed.

Best regards, Ilka

Hi Andrea,

The necessary changes are uploaded in cvs head and you can use the method canvas->RaiseWindow() to move the canvas window in front of all windows on the desktop.

Best regards, Ilka

Thank you Ilka.
But I have not understand how is possible to put a TCanvas in front of the others canvases with the new version of root.
Thank you very much
Best regards
Andrea Bulgarelli

Hi Andrea,

If you have several canvases already created (canvas1, canvas2, … canvas10) you can do:

TCanvas *can = 0;
can = (TCanvas *)gROOT->GetListOfCanvases()->FindObject("canvas2");
if (can) can->RaiseWindow();

this will put the canvas2 window on the top.

Best regards, Ilka

Hi,
this don’t work under the KDE (but it work under WindowMaker). Is it possible to do something?
Thank you very much

Best regards
Andrea Bulgarelli

Hi Andrea,

My environment is KDE and it works for me.

My settings in Window Behavior (KDE Control Modute) are: Focus Strictly Under Mouse, click raise is ON, Desktop navigation wraps around is ON.

Cheers, Ilka