Logo ROOT   6.10/09
Reference Guide
customTH1Fmenu.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_gui
3 /// Example showing how to customize a context menu for a class
4 ///
5 /// \macro_code
6 ///
7 /// \author Ilka antcheva
8 
9 {
10  cl = gROOT->GetClass("TH1F");
11 
12  cl->MakeCustomMenuList();
13  ml = cl->GetMenuList();
14 
15  ((TClassMenuItem*)ml->At(1))->SetTitle("Add histos...");
16  ((TClassMenuItem*)ml->At(2))->SetTitle("Divide histos...");
17  ((TClassMenuItem*)ml->At(3))->SetTitle("Draw panel...");
18  ((TClassMenuItem*)ml->At(4))->SetTitle("Fit one function...");
19  ((TClassMenuItem*)ml->At(5))->SetTitle("Fit panel...");
20  ((TClassMenuItem*)ml->At(6))->SetTitle("Multiply histos...");
21  ((TClassMenuItem*)ml->At(7))->SetTitle("Rebin...");
22  ((TClassMenuItem*)ml->At(8))->SetTitle("Set maximum scale...");
23  ((TClassMenuItem*)ml->At(9))->SetTitle("Set minimum scale...");
24  ((TClassMenuItem*)ml->At(10))->SetTitle("Smooth histogram");
25  ((TClassMenuItem*)ml->At(12))->SetTitle("Set name...");
26  ((TClassMenuItem*)ml->At(13))->SetTitle("Set title...");
27  ((TClassMenuItem*)ml->At(15))->SetTitle("Delete histogram");
28  ((TClassMenuItem*)ml->At(16))->SetTitle("Draw class info");
29  ((TClassMenuItem*)ml->At(17))->SetTitle("Draw clone");
30  ((TClassMenuItem*)ml->At(18))->SetTitle("Dump information");
31  ((TClassMenuItem*)ml->At(19))->SetTitle("Inspect");
32  ((TClassMenuItem*)ml->At(20))->SetTitle("Set drawing option...");
33  ((TClassMenuItem*)ml->At(22))->SetTitle("Set line attributes...");
34  ((TClassMenuItem*)ml->At(24))->SetTitle("Set fill attributes...");
35  ((TClassMenuItem*)ml->At(26))->SetTitle("Set marker attributes...");
36 
37 // Remove separators at the end, between attributes
38  mi = (TClassMenuItem*)ml->At(23);
39  delete mi;
40  mi = (TClassMenuItem*)ml->At(24);
41  delete mi;
42 }
Describes one element of the context menu associated to a class The menu item may describe...
#define gROOT
Definition: TROOT.h:375