Hi Clark,
sorry for delayed response. There is my message to Fons.
I hope these mods will help you to do what you want.
Thanks. Regards. Valeriy
-------------------------------------------------------------
Hi Fons,
I just checked a message
http://root.cern.ch/root/roottalk/roottalk02/5369.html
and added few mods to TRootBrowser which will allow to do
what Clark wants.
1. two signals added to TRootBrowser class
void BrowseObj(TObject *obj); file://*SIGNAL*
void ExecuteDefaultAction(TObject *obj); file://*SIGNAL*
2. few data members of TRootBrowser made protected
How to use it?
TBrowser *b;
TRootBrowser *imp = (TRoorBrowser*)b->GetBrowserImp();
imp->Connect("BrowseObj(TObject*)", ...
imp->Connect("ExecuteDefaultAction(TObject*)", ...
To satisfy the second request from Clark's message user should
create his own class inherited from TRootBrowser to get access
to all internal objects of TRootBrowser class, i.e.
class MyBrowserImp: public TRootBrowser {
...
};
> Hello,
>
> I hope I haven't missed this in the manual, or examples page. I'm
> building an event browser and would like to leverage the TBrowser
> class. But, I need some sort of signal or callback to indicate that an
> object has been selected. Does the browser a generic object selected
> signal, for instance Emit("ObjectBrowsed(TObject* obj)", theObject)?
>
> For my own objects, I can generate a signal by placing an Emit in the
> Browse method; however, I would also like to know when a TFile is opened
> from the menu or selected so that I can check if it contains event
> information. I could get a similar effect by adding a mime action for
> my files, but I think that means picking a "magic" file name and looses
> the ability of opening them from the browser menu. Is there a signal
> that I can connect which will tell me when a file is opened from the
> browser?
>
> Thanks,
> Clark
> --
> Clark McGrew State University of New York, Stony Brook
> (clark.mcgrew@sunysb.edu) 631-632-8299 (office)
>
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:08 MET