Hi Simon, Below a short example illustrating the use of TButton in a TCanvas. To run it, simply do: root > .x button.C The argument passed in const char* method may also be something like "gROOT->ProcessLine(\".x something.C\")" The argument in method must be a valid CINT command or a set of commands separated by ';". Note that you should not clear the pad containing the buttons. For more realistic user interfaces, use the TGButton class, etc. See examples in $ROOTSYS/test/guitest.cxx Rene Brun TH1F *h; void Fill(Int_t n) { for (Int_t i=0;i<n;i++) { h->Fill(gRandom->Gaus(0,1)); } } void button() { h = new TH1F("h","Gaus dis",100,-3,3); Fill(5000); h->Draw(); TButton *bFill = new TButton("Fill","Fill(5000);c1->Modified();",0.2,0.93,0.3,0.99); bFill->Draw(); TButton *bSmooth = new TButton("Smooth","h->Smooth();c1->Modified();",0.35,0.93,0.45,0.99); bSmooth->Draw(); TButton *bReset = new TButton("Reset","h->Reset();c1->Modified();",0.50,0.93,0.60,0.99); bReset->Draw(); } simon wrote: > > hi there rooters, > > i would just like to know how to deal with the argument const char* method that > you pass to the constructor of a TButton for instance. where do you define the > said method and how must it be specified so that it can be found in the "current > scope FILE ? > > TButton *b= new TButton("button","???",0.5,0.5, 0.6,0.6); > > where should i code the void button_func(void) method so that it can be properly > called and executed when clicking on a the button and should it be specified > where i the "???" are? > > or else, in a argument such as ".x tutorials/graph.C" > what does the x. mean? > > please help me, i'm not familiar with passing argument in that format! > > thanks
This archive was generated by hypermail 2b29 : Fri Jun 08 2001 - 11:51:24 MEST