Re: How to do grafics w/o interpreter?

From: Fons Rademakers (rdm)
Date: Sun Jul 27 1997 - 18:54:42 MEST


Hi Andre,

  have a look at $ROOTSYS/test/hworld.cxx to see how to make a
compiled program that displays histograms and other graphics
(see also hsimple.cxx for an example of a histogram producing
program without graphics).

Cheers. Fons.


> 
> 
> // Hello!
> 
> // These days I tried to use ROOT to draw some histograms like the ones
> // shown at the ROOT webpages. It didn't work...
> 
> // Well, it's fine to have a C Interpreter, but I liked to use ROOT's
> // functions in compiled programs. I hoped: some calls, and I have a pic/histogram...
> 
> // Why doesn't it work? 
> // It compiles w/o problems, but gives no output, esp. no grafical...
> // Didn't I correctly understood the idea of ROOT at all? It seems to work fine
> // via the interpreter (ROOT shell)...
> 
> // Sincerly yours, Andre Merzky.
> 
> //___________________________________________________________________________
> //TEST.C - Test Root
> //___________________________________________________________________________
> 
> #include <stdio.h>
> 
> #include "TROOT.h"
> #include "TApplication.h"
> #include "TCanvas.h"
> #include "TPaveLabel.h"
> 
> 
> //___________________________________________________________________________
> void main (void)
> {
> 	TROOT blub("Test", "Test of ROOT...");  // btw: where is this call documented?
> 	
> 	TCanvas *c1 = new TCanvas("c1");
> 	c1->Range(0,0,1,1);
> 	
> 	TPaveLabel par(0.1,0.8,0.9,0.95,"Example");
> 	par.SetFillColor(42);
> 	par.Draw();
> 	
> 	return;
> }
> 
> // PS.:
> 
> // compiled with: 
> // CC -I. -I/apps/software/root/include -I/usr/include                     \
> //     +a1 +Z  -O -w -c -o test.o test.C 
> 
> //  CC -O -g +a1 -z test.o -o test                                          \
> //     -L/apps/software/root/lib                                            \
> //     -lBase -lCint -lClib -lCont -lFunc -lGraf -lGraf3d -lHist -          \
> //     -lHtml -lMeta -lMinuit -lNet -lPostscript -lProof -lTree -lUnix      \
> //     -lZip -lGpad -lGX11 -lMotif -lWidgets -lX3d 
> 
> 


-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:20 MET