[ROOT] 2.25.03: setting TPad transparency and fill color simultaneously

From: Matthew D. Langston (langston@SLAC.stanford.edu)
Date: Tue Dec 05 2000 - 07:03:43 MET


Hi all,

I think I am trying to go about setting the transparency and fill color of a
TPad in the wrong way.

The problem I am trying to solve is to highlight a small section of a
scatterplot.  The area of the scatterplot I want to highlight represents a
cut.  My first attempt to do this was to put a TPad on top of the
scatterplot and set the TPad's transparency to 4050 (i.e. semi-transparent)
and its fill color to 2 (i.e. red).

I did this as follows:

myPad->SetFillStyle( 4050 );
myPad->SetFillColor( 2 );
myPad->Modified();
myPad->Update();

The last two commands (i.e. the calls to Modified and Update) don't do
anything from the command line.  I have to use the SetFillAttributes context
menu of myPad to set the fill color to red by clicking the Apply button.  Is
this right?  Isn't there a way to do this from the command line?

It appears that only one of these settings (i.e. transparency and fill
color) can take affect at the same time, i.e. I can either have a
semi-transparent TPad that has no color (so that I can see the scatterplot
points below it), a solid red TPad (that hides the scatterplot points
beneath it), but not both.

So, is it possible to set the transparency and the fill color of a TPad
simultaneously?  If so, is there a way to do it from the command line?

Also, is this the right way to highlight a section of a scatterplot?  Would
it be better to use something like a TBox or a TWbox instead?

Thank you for any help.

Regards, Matt

--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:38 MET