Re:

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Wed Mar 19 1997 - 11:32:41 MET


Hi Maarten,

   you seem to have something not completely correct in you TApplication
ctor. Could you show me the code where you create TApplication. I've
guessed what went wrong more or less and added an extra protection to
prevent the problem from happening in the future.

ROOT does not take over anything unless you ask it to do so. It will
take over when you call TApplication::Run() which will cause ROOT to
enter the X11 or Win32 eventloop. At this stage you will be able to
interact with the objects on the screen (in case you display something
in a canvas). However, at this level the interpreter is not used. To
activate the interpreter you will have to call TRint::Run() (TRint
inherits from TApplication). The TRint::Run() will enter the graphics
and commandline eventloop and one can type commands on the console.
These commands will be interpreted by the interpreter. So to summarize,
if you want to use only a few graphics primitives to draw in a canvas
you can do so without giving your whole program over to ROOT (see the
example program posted yesterday). However, by doing so you will
miss out on quite a number of nice features of the framework (e.g.
object I/O, fast prototyping via dynamic loading of private classes
and access to your classes via the interpreter, etc.).

Cheers, Fons.


Maarten Bruinsma wrote:
> 
> Dear fellow root users,
> 
> I have just written my first stand-alone program using Root's libraries
> and came up with the following errors, that reminded me of errors I got
> when I first used Root as such. I did not have a clue then and nor do I
> have one now. Maybe someone has an idea of what goes wrong?
> Here is the output:
> 
>  *** Break *** segmentation violation
> 
> ( 0)  0x81342330   StackTrace__11TUnixSystemFv + 0x30  [/
> ( 1)  0x81340ccc   DispatchSignals__11TUnixSystemF8ESignals + 0x12c
> [/user/s37/root/lib/libUnix.sl]
>  2)  0x8133f894   SigHandler__F8ESignals + 0x2c
> ( 3)  0x81343da0   sighandler__Fi + 0x5c
> [/user/s37/root/lib/libUnix.sl]l]
> ( 3)  0x81343da0   sighandler__Fi + 0x5c  [/user/s37/root/lib/libUnix.sl]
> ( 4)  0x800aefc0   sigreturn  [/lib/libc.sl]
> ( 5)  0x800c40fc   strlen + 0xc  [/lib/libc.sl]
> ( 6)  0x8133fe1c   SetProgname__11TUnixSystemFPCc + 0x28
> [/user/s37/root/lib/libUnix.sl]
> ( 7)    0x813ce674   ct__12TApplicationFPCcPiPPcPvi + 0x1d0
> [/user/s37/root/lib/libRint.s
> [/user/s37/root/lib/libRint.sl]
> ( 8)  0x00008dcc   Plot_On_Screen__5TrackFPA16_8CellInfo + 0x50
> ( 8)  0x00008dcc   Plot_On_Screen__5TrackFPA16_8CellInfo + 0x50
> [./anacos][./anacos]
> ( 9)  0x0000692c   main + 0x140  [./anacos]
> (10)  0x80042154   start + 0x70  [/lib/libc.sl]
> (11)  0x00005f14   $START$ + 0x9c  [./anacos]
> 
> IOT trap (core dumped)
> 
> BTW. is it true that ROOT takes over the whole program and interprets
> every command in stead of just giving access to graphical routines?
> 
> Best regards,
> 
> Maarten
> 
> *************************************************************************
> *                         Maarten Bruinsma                              *
> *                     -----------------------                           *
> *           Werk:                            Prive:                     *
> *       NIKHEF/ HERA B                   Ruysdaelkade 189 HS            *
> *       Kruislaan 409                    1072 AV AMSTERDAM              *
> *       Postbus 41882                    tel. (020) 6758856             *
> *       1009 DB AMSTERDAM                                               *
> *       tel. (020) 5922116               email: t26@nikhef.nl           *
> *       fax. (020) 5995155               http://www.nikhef.nl/user/t26/ *
> *************************************************************************

-- 
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 7822601



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