Re: [ROOT] LineWidth : in 'pixels' ?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Feb 06 2001 - 09:59:45 MET


Hi Yannick,

The SetY2NDC function can only operate after having drawn the object.
You can code something like:

  TPaveText *tpvt = new TPaveText(0.1,0.1,0.2,0.2);
  tpvt->Draw();
  tpvt->SetY2NDC(0.9);
  gPad->Modified();

Concerning your PS of yesterday:
 - When you use unnamed macros, you should start the macro with:
     gROOT->Reset();
   if you want to execute this macro multiple times. gROOT->Reset will cleanup
   all objects, pointers created at this point. For example, if in your macro
   you had declared objects in the stack such as
       TCanvas c1("c1");
   it would be an error to attempt creating again this object in the stack.
   Reset will clean the environment.
   Unnamed macros are OK for simple operations. They have the advantage that
   all objects created in the macro are still available at the command line.
   However, it is better to use standard C++ named macros with the corresponding
   scoping rules: an object in the stack is automatically deleted when you
   finish the execution of the macro. My advice is to always use named macros.
   With named macros, you should not have a gROOT->Reset at the beginning
   of the macro.

 - About html and include files.
   For a given class XXX We provide the files:
     - htmldoc/XXX.html: this file is an hyperized view of the include file
       plus an extraction of the commented part of the source.
     - htmldoc/XXX.h the original unmodified header file. This file may contain
       code not processed by the above html file when preprocessor instructions
       are specified.
     - htmldoc/src/XXX.cxx.html: an hyperized view of the source file.     

   Note that we also provide hyperized include files in the CVS cross-reference.
For example, see: http://root.cern.ch/lxr/. Type in a keyword, eg TPaveText.
You will see a list of html pages referencing TPaveText. You can for example,
select: http://root.cern.ch/lxr/source/graf/inc/TPaveText.h#47

Rene Brun

Patois Yannick wrote:
> 
> On Mon, 5 Feb 2001, Rene Brun wrote:
> 
> >    //Width_t lw = Width_t(fH->GetLineWidth()*gPad->GetAbsHNDC() + 0.5); //old
> >    Width_t lw = Width_t(fH->GetLineWidth()*gPad->GetWh()/800. + 0.5);   //new
> 
> Hi Rene, thanx for your explanations.
> I'll left the PSs as they are still un-answered :)
> 
> And I have another question:
> If I do:
> // test2.C
> {
>   TPaveText *tpvt = new TPaveText(0.1,0.1,0.2,0.2);
>   tpvt->SetY2NDC(0.9);
>   tpvt->DrawNDC();
> }
> 
> The pave doesnt acknowledge the SetY2NDC command.
> Adding an explicit 'ConvertNDCtoPad changes nothing.
> 
>         Yannick
> 
> > > PS1: On my system, the previous test break CINT at second invocation
> > > (did I made an obvious mistake?):
> > >   *   Version   3.00/02   18 January 2001   *
> > > root [0] .x test.C
> > > (fits vals) OK
> > > root [1] .x test.C
> > > Warning in <TH1::Build>: Replacing existing histogram: h1
> > > (fits val)
> > >  *** Break *** segmentation violation
> > >
> > > PS2: The HTML presentation of the class is very useful and clever,
> > > nicely presented, full of coments and hyperlinks, but why cant it be the
> > > same for the .h files ? If I have the bad luck to seek for informations
> > > related to an inline method, I'm send to an ugly looking file without
> > > any fontification, neither comments or help of any kind. Is there a good
> > > reason for it ?
> >



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:35 MET