Delete Tab Window

Dear Rooters,
I have created a small Gui for Root simulations. The concept is to list the name of the root files on the right part of the window and for every file name that it is selected to present a Window of tabs with some details of the files on the right part of the main window.
I want every time that I select a file name to delete the previous tab window that I have created and create a new one.
I send you a photo of the application and also the code that I have created. Thank you in advance !!
BrowserCode.txt (12 KB)


Hi,

You can simply take a look at the guitest example (either $(ROOTSYS)/test/guitest.cxx or $(ROOTSYS)/tutorials/gui/guitest.C), search for fTab->RemoveTab
(but it sounds very sub-optimal and error prone…)

Cheers, Bertrand.

Dear Bellenot,
thank you for your quick response. I have already tried to use the RemoveTab order but it seems that it doesn’t work properly. I wrote in the DeleteTabs function these orders:
fTab->RemoveTab(0);
fTab->RemoveTab(0);
fTab->RemoveTab(0);
Because it doesn’t delete possibly a frame of the window. I attach you a photo in order to understand.
Then I thought to delete the frames that i have created so i wrote on the delete tabs function these:
fTab->RemoveTab(0);
fTab->RemoveTab(0);
fTab->RemoveTab(0);
delete fL;
delete fFrun;
delete fFproc;
But still there is a problem because it seems like something is not being deleted. I attach you an other photo to understand:



Hi,

Could you attach a [color=#00BF00]running[/color] piece of code showing the problem? (there are missing dependencies with the code you attached before)

Cheers, Bertrand.

Yes of course. This is a running piece of the code. Thank you very much !!
simple code.txt (7.68 KB)

Well, it doesn’t show anything… Anyway, I’ll come with a working example, but it will take some time…

Cheers, Bertrand.

I attached it once more just in case I did something wrong the first time.
Thank you in advance!
simplecode.c (7.43 KB)

Anyway, here is a working example illustrating how to do it. Now you simply have to adapt to your specific needs…
test_remove_tabs.C (6.91 KB)

It worked !!! Thank you very much !!! :smiley: :smiley:

You’re very welcome! :slight_smile: