Hi Rutger,
As a follow-on to your mail to roottalk, I suggest you post
to roottalk this interesting info. It could be useful to many
other people.
I am currently at FNAL for 3 weeks. Note that Fons is at LBL/SLAC
and he will be back at CERN only on Monday.
I am interested to have a demo of your event display once you
will be well settled in October.
Rene
Rutger van der Eijk wrote:
>
> On Thu, 10 Sep 1998, Rene Brun wrote:
>
> > Rutger van der Eijk wrote:
> > >
> > > Hi Rene/Fons
> > >
> > > Hi included are picture and a test program. I've looked a bit further into
> > > the matter. Rene, you might be right that something is overwritten. I
> > > checked the # colors in the color list before and after retrieving the
> > > picture. In both cases they are zero! But after starting the canvas
> > > ('after') there are 179 colors defined but they seem all to be 'white'.
> > >
> > > Another strange thing: I run this on a 'standard' xterminal @ NIKHEF,
> > > logging in to a HPUX 10 machine => the problem occurs. But when I run this
> > > on a local pc, running Win-NT (uhm...), using PC-Xware as xWindows
> > > emulator (and logging in to the same HP!!!), I don't have the problem...
> > > I'm getting puzzeled...
> > >
> > > Can you try the program + picture on your machine(s), and see if you also
> > > have the problem. (somehow I hope you do have the problem... :-) )
> > >
> >
> > Hi Rutger,
> > I tried your xpm file (nice lhcb logo!) and I have no problems
> > with the canvas (after).
> > I am suspecting a problem with the color table in your Xterminal.
> > When you say that the 179 colors are white, do you mean that you
> > have dumped the 179 TColor objects and the RGB data members are
> > all set to white? Could you check that?
> > If the TColor data members are correct, the problem will definitively be
> > with the software in your Xterminal.
> > Rene
>
> Hi Rene,
>
> I checked the 179 TColor objects. The RGB data members are set correctly,
> so you are right that the problem is related to the XTerminal. Thinking a
> bit further (and asking a local computing goeroe) I'm quite sure the
> 'problem' and cause for the different behaviour between PC/XTerminal is
> the following:
>
> Most (at least old) XTerminals use 256 colors (8bit), which are indexed to
> a color palette which contain 'all' colors. Once this indexing is done,
> this are the colors you can use in your session. Usually your X-env gives
> the feature to use a color palettes for each window. (which you have
> probly seen: the change in colors when using Netscape with it's 'own'
> colors). On (the newer) PC's there is usually a 24bit video-card so then
> this strange mapping on a palette is not necesarry and concequently not
> used.
>
> What does this mean in my example program?
>
> Retrieving the picture from the gClient causes the allocation (i.e.
> mapping) of the colors as needed by the picture. Then when
> TCanvas::Build() want to map the 'ROOT colors' it can not allocate them,
> and concequently thet appear 'white'.
>
> I testes the above hypothesis by making a black/white version of the
> picture. Indeed the color indices are now available for ROOT.
>
> Oke. So this seems to be the problem. I quess you probably you run linux
> on a PC so you don't have the problem, but I surely think it is a common
> problem (maybe you could check it again on a standard XTerminal.).
>
> For the moment I 'work-around' this problem by opening a dummy TCanvas
> (and directly close it again) before retrieving the picture. Could you do
> the initialization of the 'ROOT colors' somewhere at the start up of the
> program or the first use of TGClient or so? Another (quicker, but
> less logical/'nice' I think) option would be to make TClient::Build() (or
> the part that initialises the colors) a static member. Afterall it are
> 'global' items which are set in the member, they are not a part of the
> (first) created TCanvas object.
>
> Thanks again, at hope this is/solves the problem,
>
> Rutger
>
> p.s. From tomorrow evening until next Friday (18th) I will be at CERN for
> the LHCb week and to look for an appartment (I will be 'based' at CERN for
> one year starting in October). I have a (small) list of 'general' ROOT
> questions and you (Fons) might be intrested to have a small demo of the
> present status of Testbeam software which is strongly based on ROOT
> classes, so maybe we could meet somewhere after lunch.