Hello,
I am a new ROOT and c++ user. I am trying use ROOT in Microsoft Visual Studio 2013. I have gone through most of the steps I think are necessary to be successful in my endeavors. However, when I try the example code below, I expect a TCanvas to be generated in a new window, but no such window is generated.
// This small demo shows the traditional "Hello World". Its main use is
// to show how to use ROOT graphics and how to enter the eventloop to
// be able to interact with the graphics.
#include "TApplication.h"
#include "TCanvas.h"
#include "TLine.h"
#include "TPaveLabel.h"
#include "TGraph.h"
int main(int argc, char **argv)
{
TApplication theApp("App", &argc, argv);
TCanvas *c = new TCanvas("c", "The Hello Canvas", 400, 400);
c->Connect("Closed()", "TApplication", &theApp, "Terminate()");
int x[10], y[10]; int i;
for(i = 0; i < 10; i++) {
x[i] = 10*i;
y[i] = i;
}
TGraph *gr = new TGraph(10,x,y);
gr->SetLineColor(2);
gr->SetLineWidth(1);
gr->SetMarkerColor(4);
gr->SetMarkerStyle(1);
gr->Draw("AL");
TPaveLabel *hello = new TPaveLabel(10.,8.,90.,9.,"Hello World");
hello->Draw();
TPaveLabel *quit = new TPaveLabel(10.,6.,90.,7.,"Close via menu File/Quit");
quit->Draw();
c->Modified();
c->Update();
theApp.Run();
return 0;
}