Logo ROOT  
Reference Guide
demoshelp.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_pyroot
3## \notebook
4## Display demo help.
5##
6## \macro_code
7##
8## \author Wim Lavrijsen
9
10import os
11from ROOT import TCanvas, TPaveText
12from ROOT import gROOT
13
14
15
16chelp = TCanvas( 'chelp', 'Help to run demos', 200, 10, 700, 500 )
17
18welcome = TPaveText( .1, .8, .9, .97 )
19welcome.AddText( 'Welcome to the ROOT demos' )
20welcome.SetTextFont( 32 )
21welcome.SetTextColor( 4 )
22welcome.SetFillColor( 24 )
23welcome.Draw()
24
25hdemo = TPaveText( .05, .05, .95, .7 )
26hdemo.SetTextAlign( 12 )
27hdemo.SetTextFont( 52 )
28
29text = """- Run demo hsimple.py first. Then in any order
30- Click left mouse button to execute one demo
31- Click right mouse button to see the title of the demo
32- Click on 'Close Bar' to exit from the demo menu
33- Select 'File/Print' to print a Postscript view of the canvas
34- You can execute a demo with the mouse or type commands
35- During the demo (try on this canvas) you can:
36 .... Use left button to move/grow/etc objects
37 .... Use middle button to pop overlapping objects
38 .... Use right button to get an object sensitive pop-up
39 """
40for line in text.split( os.linesep ):
41 hdemo.AddText( line )
42
43hdemo.SetAllWith( '....', 'color', 2 )
44hdemo.SetAllWith( '....', 'font', 72 )
45hdemo.SetAllWith( '....', 'size', 0.04 )
46
47hdemo.Draw()
48chelp.Update()
The Canvas class.
Definition: TCanvas.h:31
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21