From $ROOTSYS/tutorials/gui/customTH1Fmenu.C

//How to customize a context menu for a class
//Author: Ilka antcheva

{
   cl = gROOT->GetClass("TH1F");

   cl->MakeCustomMenuList();
   ml = cl->GetMenuList();

   ((TClassMenuItem*)ml->At(1))->SetTitle("Add histos...");
   ((TClassMenuItem*)ml->At(2))->SetTitle("Divide histos...");
   ((TClassMenuItem*)ml->At(3))->SetTitle("Draw panel...");
   ((TClassMenuItem*)ml->At(4))->SetTitle("Fit one function...");
   ((TClassMenuItem*)ml->At(5))->SetTitle("Fit panel...");
   ((TClassMenuItem*)ml->At(6))->SetTitle("Multiply histos...");
   ((TClassMenuItem*)ml->At(7))->SetTitle("Rebin...");
   ((TClassMenuItem*)ml->At(8))->SetTitle("Set maximum scale...");
   ((TClassMenuItem*)ml->At(9))->SetTitle("Set minimum scale...");
   ((TClassMenuItem*)ml->At(10))->SetTitle("Smooth histogram");
   ((TClassMenuItem*)ml->At(12))->SetTitle("Set name...");
   ((TClassMenuItem*)ml->At(13))->SetTitle("Set title...");
   ((TClassMenuItem*)ml->At(15))->SetTitle("Delete histogram");
   ((TClassMenuItem*)ml->At(16))->SetTitle("Draw class info");
   ((TClassMenuItem*)ml->At(17))->SetTitle("Draw clone");
   ((TClassMenuItem*)ml->At(18))->SetTitle("Dump information");
   ((TClassMenuItem*)ml->At(19))->SetTitle("Inspect");
   ((TClassMenuItem*)ml->At(20))->SetTitle("Set drawing option...");
   ((TClassMenuItem*)ml->At(22))->SetTitle("Set line attributes...");
   ((TClassMenuItem*)ml->At(24))->SetTitle("Set fill attributes...");
   ((TClassMenuItem*)ml->At(26))->SetTitle("Set marker attributes...");

// Remove separators at the end, between attributes
   mi = (TClassMenuItem*)ml->At(23);
   delete mi;
   mi = (TClassMenuItem*)ml->At(24);
   delete mi;
}
 customTH1Fmenu.C:1
 customTH1Fmenu.C:2
 customTH1Fmenu.C:3
 customTH1Fmenu.C:4
 customTH1Fmenu.C:5
 customTH1Fmenu.C:6
 customTH1Fmenu.C:7
 customTH1Fmenu.C:8
 customTH1Fmenu.C:9
 customTH1Fmenu.C:10
 customTH1Fmenu.C:11
 customTH1Fmenu.C:12
 customTH1Fmenu.C:13
 customTH1Fmenu.C:14
 customTH1Fmenu.C:15
 customTH1Fmenu.C:16
 customTH1Fmenu.C:17
 customTH1Fmenu.C:18
 customTH1Fmenu.C:19
 customTH1Fmenu.C:20
 customTH1Fmenu.C:21
 customTH1Fmenu.C:22
 customTH1Fmenu.C:23
 customTH1Fmenu.C:24
 customTH1Fmenu.C:25
 customTH1Fmenu.C:26
 customTH1Fmenu.C:27
 customTH1Fmenu.C:28
 customTH1Fmenu.C:29
 customTH1Fmenu.C:30
 customTH1Fmenu.C:31
 customTH1Fmenu.C:32
 customTH1Fmenu.C:33
 customTH1Fmenu.C:34
 customTH1Fmenu.C:35
 customTH1Fmenu.C:36
 customTH1Fmenu.C:37
 customTH1Fmenu.C:38