https://github.com/root-project/root
Raw File
Tip revision: dd4fcde9afed9172a2445f01c7c9a0b6cd6151d7 authored by Philippe Canal on 02 December 2016, 23:07:29 UTC
Add part of v6.08/02 release notes
Tip revision: dd4fcde
Hello.h

///////////////////////////////////////////////////////////////////
//  Animated Text with cool wave effect.
//
//  ROOT implementation of the hello world example borrowed
//  from the Qt hello world example.
//
//  To run this example do the following:
//  $ root
//  root [0] gSystem.Load("Hello")
//  root [1] Hello h
//  <enjoy>
//  root [2] .q
//
//  Other ROOT fun examples: Tetris, Aclock ...
///////////////////////////////////////////////////////////////////

#ifndef HELLO_H
#define HELLO_H

#include <TTimer.h>
#include <TCanvas.h>
#include <TText.h>

class TList;

class TChar : public TText {

public:
   TChar(char ch='\0',Coord_t x=0, Coord_t y=0);
   virtual ~TChar() { }

   char GetChar() {
      return GetTitle()[0];
   }

   virtual Float_t GetWidth();
};


class Hello : public TTimer {

private:
   TList  *fList;     // list of characters
   UInt_t  fI;        // "infinit"  counter
   TPad   *fPad;      // pad where this text is drawn

public:
   Hello(const char *text = "Hello, World!");
   virtual ~Hello();

   Bool_t  Notify();
   void    ExecuteEvent(Int_t event, Int_t px, Int_t py);
   Int_t   DistancetoPrimitive(Int_t, Int_t) { return 0; }

   Float_t GetWidth();
   void    Paint(Option_t* option="");
   void    Print(Option_t * = "") const;
   void    ls(Option_t * = "") const;
   TList  *GetList() { return fList; }

   ClassDef(Hello,0)   // animated text with cool wave effect
};

#endif
back to top