I’m currently writing a GUI where I need to embed a browser in a frame. I found nothing in the root documentation that can fit my needs.
Is there something that can works in this way ? :
TGMainFrame *pMainFrame = new TGMainFrame(gClient->GetRoot());
TEmbeddedBrowser *pBrowser = new TEmbeddedBrowser(pMainFrame);
TDirectory *pRootDir = new TDirectory("root","/");
TH1D *pH = new TH1D("h","h",10, 0, 9);
I need a tree list view for a set of objects. I know that there is the TGListTree and its TGListTreeItem but i just wonder if there is an existing class that already wraps this TGListTree as the TBrowser does and that can be embedded in a frame.
You can take a look at the $ROOTSYS/tutorials/gui/guitest.C tutorial, the “File List…” entry in the “Test” menu.
Thanks for your answer and redirecting me to this example. I took a look to the latter but its class for browsing the file list provide a raw implementation of the browser. Even worst, it is for file system browsing and I want to create my own directories locally.
Maybe, is there a way to draw a TDirectory in a frame ? This should works for me since the TDirectory implements at least the storage of directories and objects. Then I will just need to find a way to draw it somewhere.
[quote=“rete”]Even worst, it is for file system browsing and I want to create my own directories locally[/quote]I’m not sure I understand your point. What is the difference between “file system” and “your own directories locally”?
And BTW, you can also embed a pair of TGListView/TGFileContainer:
fFileView = new TGListView(fC2,600,200);
fFileCont = new TGFileContainer(fFileView->GetViewPort(),100,102,
fC2->AddFrame(fFileView, new TGLayoutHints(kLHintsLeft|kLHintsTop,5,2,2,2));
Where FC2 is a TGCompositeFrame
Sorry, I think I’m not clear.
The left frame of the TBrowser is doing exactly what I want. It contains by default “root” , “PROOF Sessions” , “ROOT Files” and “/”. I would only this container but an empty one, embedded in my frame so that user can create its own folders and sub-folders and put TObjects inside.
Tell me if not clear again. Sorry if it’s again the case.
The left part of the ROOT browser if a TGFileBrowser, and it inherits from TBrowser. You can try to use it, but if you want a very customized version, you will need to do it yourself…
Thank you a lot.
I finally find the way to do what I want from the TGFileBrowser.
It looks like this :
// Embed the browser in my frame
TGMainFrame *pMyMainFrame = new TGMainFrame(gClient->GetRoot());
TGFileBrowser *pBrowser = new TGFileBrowser(pMyMainFrame);
// following code is just an example of what I wanted to display ...
TDirectory *pRunDir = new TDirectory("run", "Run");
TDirectory *pSubRunDir = pRunDir->mkdir("SubRun");
TH1D *pH = new TH1D("h", "h", 10, 0, 9);
Thanks again. I set the post as resolved.