Hi
I was wondering how to pass an action to a TCotrolBar object with python
i.e.
cbar.AddButton( "All Variables" , "Action()" , "Plot all the variables" , "button" )
In a root script I can define a sub called Action, but what about Python?
I have tried to do the same creating a sub
def Action():
<DO SOMETHING>
but it does not work.
So then I tried to pass instead a string like
Action = "cout << \"TEST\" << endl;"
and it works.
But my problem now is that I have to create a dynamic string like
Action = "for (int i = 0 ; i<%i; i++) { .x %s/correlationscatters.C(\"%s\",\"%s\",%i,%i) }" % (it,scriptpath, namefile.Data(), Var[i].Data(), type, batch)
where the TString list Var[i] is defined before.
I think that it is possible to do that or there is something more easy?
Thanks
A
--Received on Thu Jul 09 2009 - 17:50:03 CEST
-------------------------------------------------------
Alfio RIZZO Vrije Universiteit Brussel Faculteit Wetenschappen, Dienst ELEM Gebouw G, Bureau 0G-111 Pleinlaan, 2 B-1050 Brussels BELGIUM Tel. +32(0)26293220 Fax +32(0)26293816 alfio.rizzo_at_vub.ac.be w3.iihe.ac.be/~rizzo
-------------------------------------------------------
This archive was generated by hypermail 2.2.0 : Thu Jul 09 2009 - 23:50:02 CEST