Example showing how to add a function to the class context menu.
void poptest1(int a=5, int b = 56);
void poptest2(
int a,
int b,
TObject* c);
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);
}
void poptest2(
int a,
int b,
TObject *c)
{
printf("poptest2 %d %d\n",a,b);
printf(
"histo : %lx\n",(
Long_t)c);
printf(
"title of the histogram : %s\n",((
TH1F*)c)->GetTitle());
}
{
printf("poptest2bis\n");
printf(
"histo : %lx\n",(
Long_t)c);
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);
}
- Author
- Ilka Antcheva
Definition in file customContextMenu.C.