Re: Writing a TCanvas into a root - file

Rene Brun (Rene.Brun@cern.ch)
Sat, 29 Aug 1998 11:39:08 +0200


ROHLFS Reiner wrote:
>
> Hi ROOT Team,
>
> I want to write a TCanvas object into a root file and read it back using the
> TCanvas::Draw() function to display the TCanvas - Window again on the screen.
> I noticed some problems:
>
> - The TCanvas which is read from the root file always has a menu bar
> independent of the style of the original TCanvas which was written to the root
> file. ( Properly the function call in TCanvas::Draw() of
> fCanvasImp->ShowMenuBar(1) should be modified to
> fCanvasImp->ShowMenuBar(fMenuBar))

This attribute is currently not saved/restored in TCanvas::Streamer.
I will add it and also make the mods in TCanvas::Draw.

>
> - The size and the position of the TCanvas read from the root file has changed
> compared to the size and the position of the original TCanvas which was written
> to the root file. On my system the Y - Position is +7 Pixel, the Y - Position
> is +50 Pixel, the Width is -4 Pixel and the Height is - 28 Pixel each time I
> save a TCanvas Window and read it back from the root file.
>
> - After the user has moved the window on the screen the old X/Y positions are
> written to the root file, not the new ones. I can update the X/Y positions
> (fCtopX and fCtopY) each time before I write the TCanvas into a root file but
> it may be better to update these values each time a user moves the window.

This part could also be implemented, however this requires
several changes in TCanvas. We will look into it.

Thanks for the remarks.

Rene Brun