Example showing how to add a function to the class context menu.
void poptest1(
int a=5,
int b = 56);
int poptest3();
void poptest4(char* ch);
void customContextMenu()
{
h =
new TH1F(
"h",
"Schtroumpf",100,-4,4);
h2 =
new TH1F(
"h2",
"h2",1000,-4,4);
"Test object, draw a second h","Draw",h2,"Option_t*");
"test no 4","poptest4",0,"const char*");
"test no 3","poptest3",0,"");
"test no 2 bis","poptest2bis",0,"TObject*",2);
"test no 2","poptest2",0,"int,int,TObject*",2);
"test no 1","poptest1",0,"int,int");
}
void poptest1(
int a,
int b)
{
printf(
"poptest1 %d %d\n",
a,
b);
}
{
printf(
"poptest2 %d %d\n",
a,
b);
printf(
"title of the histogram : %s\n",((
TH1F*)
c)->GetTitle());
}
{
printf("poptest2bis\n");
printf(
"title of the histogram : %s\n",((
TH1F*)
c)->GetTitle());
}
int poptest3()
{
printf("poptest3\n");
return 12;
}
void poptest4(const char *ch)
{
printf("poptest4 %s\n",ch);
}
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetMenuList() const
Return the list of menu items associated with the class.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void FillRandom(const char *fname, Int_t ntimes=5000)
Fill histogram following distribution in function fname.
Mother of all ROOT objects.