RE: [ROOT] TBrowser Question

From: Faine, Valeri (fine@bnl.gov)
Date: Wed Apr 16 2003 - 18:49:36 MEST


I think TBrowser::GetSelected() 
http://root.cern.ch/root/htmldoc/TBrowser.html#TBrowser:GetSelected 
returns the TObject pointer to the object you have clicked.
However you (your compiled code) have to CALL it on its own.

This means somewhere in your code your should create a browser object

  TBrowser *myBrowser = new TBrowser();

Then you can access it via 

   TObject *selectedObject = myBrowser->GetSelected();

If you want to be notified about the recent object selection then the
Qt-based browser can do this job because it emits the Qt signal 
(see: http://doc.trolltech.com/3.0/signalsandslots.html  ) when the
object is clicked.
(see http://root.bnl.gov Web site for the further information )

                  Hope this helps, Valeri

> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]
> On Behalf Of Michael T. Gericke
> Sent: Monday, April 14, 2003 11:39 AM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] TBrowser Question
> 
> Dear Rooters,
> 
> Does anyone know how I can (if I can) get a browser, which I am
opening
> in a compiled program, to return the name of the object (histogram)
> as I double click on it...
> 
> More generally, is there a way to add function calls that are executed
> when an event is generated in a TBrowser? I can't find a
> ProcessEvents(..) function for that class...
> 
> 
> Thanks,
> 
> Michael
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET