hworld.cxx

Go to the documentation of this file.
00001 // @(#)root/test:$Id: hworld.cxx 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Fons Rademakers   04/04/97
00003 
00004 // This small demo shows the traditional "Hello World". Its main use is
00005 // to show how to use ROOT graphics and how to enter the eventloop to
00006 // be able to interact with the graphics.
00007 
00008 #include "TApplication.h"
00009 #include "TCanvas.h"
00010 #include "TLine.h"
00011 #include "TPaveLabel.h"
00012 
00013 int main(int argc, char **argv)
00014 {
00015    TApplication theApp("App", &argc, argv);
00016 
00017    TCanvas *c = new TCanvas("c", "The Hello Canvas", 400, 400);
00018    c->Connect("Closed()", "TApplication", &theApp, "Terminate()");
00019 
00020    TPaveLabel *hello = new TPaveLabel(0.2,0.4,0.8,0.6,"Hello World");
00021    hello->Draw();
00022    TPaveLabel *quit = new TPaveLabel(0.2,0.2,0.8,0.3,"Close via menu File/Quit");
00023    quit->Draw();
00024    c->Update();
00025    theApp.Run();
00026    return 0;
00027 }

Generated on Tue Jul 5 15:15:03 2011 for ROOT_528-00b_version by  doxygen 1.5.1