How to add file browser to gui

OK, I see, but you left tabs can be integrated on the left part of the browser (just adding tabs) and for the menu… I’ll have to see if there is a solution (I think there is one)

This can be a solution. But I will still have this right bottom part of the TBrowser (“command”) that I don’t need. That’s a pity that I can just not add this Files tab of the browser in the tabs of my GUI

The bottom part can easily be hidden. But as I said, it’s up to you to decide what you want to do.

But how can you hide the bottom part ? If this is possible, and if I can remove and add what I want in the menu file, then I like this solution. (sorry I am very stubborn)

BTW, you can perfectly embed a TGFileBrowser in your GUI, and connect to the DoubleClicked() signal (from TGListTree), and even to all those signals:

   virtual void MouseOver(TGListTreeItem *entry);  //*SIGNAL*
   virtual void MouseOver(TGListTreeItem *entry, UInt_t mask);  //*SIGNAL*
   virtual void KeyPressed(TGListTreeItem *entry, UInt_t keysym, UInt_t mask);  //*SIGNAL*
   virtual void ReturnPressed(TGListTreeItem *entry);  //*SIGNAL*
   virtual void Clicked(TGListTreeItem *entry, Int_t btn);  //*SIGNAL*
   virtual void Clicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y);  //*SIGNAL*
   virtual void Clicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y);  //*SIGNAL*
   virtual void DoubleClicked(TGListTreeItem *entry, Int_t btn);  //*SIGNAL*
   virtual void DoubleClicked(TGListTreeItem *entry, Int_t btn, Int_t x, Int_t y);  //*SIGNAL*
   virtual void Checked(TObject *obj, Bool_t check);  //*SIGNAL*
   virtual void DataDropped(TGListTreeItem *item, TDNDData *data);  //*SIGNAL*

but you’ll have to implement everything yourself anyway…

But how can I get the pointer to the TGListTree ? It’s a protected variable

Use the static TQObject::Connect() method, for example:

   TQObject::Connect("TGListTree", "DoubleClicked(TGListTreeItem *, Int_t)",
                     "YourClass", this, "YourMethod(TGListTreeItem *, Int_t)");

And then, implement whatever you want in YourClass::YourMethod(TGListTreeItem *, Int_t), but since this connect to any TGListTree object, you’ll have to make sure the signal is coming from the one of the TGFileBrowser, for example by checking its parent. In the slot:

TGListTree *sender = (TGListTree *)gTQSender;

Ok thank you, I will try this. Thank you for your time :wink:

FYI, I just edited the example