Logo ROOT   6.12/07
Reference Guide
text.cxx File Reference

Detailed Description

/*************************************************************************
* Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
R__LOAD_LIBRARY(libGpad);
// #include "ROOT/TFile.hxx"
#include "ROOT/TCanvas.hxx"
#include "ROOT/TColor.hxx"
#include "ROOT/TText.hxx"
void text()
{
using namespace ROOT;
// Create a canvas to be displayed.
auto canvas = Experimental::TCanvas::Create("Canvas Title");
auto text = std::make_shared<ROOT::Experimental::TText>("Hello World");
canvas->Draw(text).SetFillColor(Experimental::TColor::kRed);
// Register the text with ROOT: now it lives even after draw() ends.
canvas->Show();
// TFile *f = TFile::Open("canv7.root", "recreate");
// f->WriteObject(canvas.get(), "canv_text");
// delete f;
}
Date
2017-10-17
Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
Author
Olivier couet Olivi.nosp@m.er.C.nosp@m.ouet@.nosp@m.cern.nosp@m..ch

Definition in file text.cxx.