Re: Canvas is not shown.

From: Jayoung Wu (jayoung@glue.umd.edu)
Date: Wed Mar 04 1998 - 19:36:11 MET


On Wed, 4 Mar 1998, Fons Rademakers wrote:
> 
> Now to make your program in point 3) work as expected, add the lines:
> 
> int main()
> {
>    TROOT ytrack("plot2","plot test");
> 
>    // Create application environment, needed for interactive apps.
>    // Alternatively can create a TRint object, I which case you
>    // get also command line input capability.
>    TApplication theApp("App", 0, 0);
> 
>    TCanvas *c1 = new TCanvas("c1","Tracking of Incident Particle",
>                              200,10,700,500);
>    c1->Update();
> 
>    theApp.Run();    // will not return
> 
>    return 0;
> }
> 
> 
> For more detail see $ROOTSYS/test/hworld.cxx.
> 
> Cheers, Fons.
> 

For point 3) I tried according to your suggestion but I got the error
message: 
     *** Break *** segmentation violation
     IOT trap
 
======================= My code was
#include <stdio.h>
#include <math.h>

#include "TROOT.h"
#include "TFile.h"
#include "TTree.h"
#include "TBranch.h"
#include "TObject.h"
#include "TH1.h"
#include "TCanvas.h"
#include "TApplication.h"

Int_t main()
{
  TROOT ytrack("plot2","plot test");
  TApplication theApp("App", 0, 0);

  TCanvas *c1 = new TCanvas("c1","Tracking of Incident Particle",
				  200,10,700,500);

//  c1->Modified();
  c1->Update();

  theApp.Run();
  return 0; 

}

---
Thanks a lot!
Jayoung



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