Closing a window without closing the ROOT terminal

Hey!

I have a launcher which starts a new window TEveBrowser using TEveManager.
I want to exit this TEveBrowser without exiting the whole program; in other words I want launcher to continue working. How could I do this?

Thank you!

Hi,

You could try this:

TEveBrowser *browser = gEve->GetBrowser(); browser->GetMainFrame()->CloseWindow();
Cheers, Bertrand.

I get an exception with it :frowning:

This seems to work. It closes the window, but after it, I cannot reopen the window again. :frowning:

OK, but did you try what I proposed?

EDIT: or even (if you prefer one line command):gEve->GetBrowser()->GetMainFrame()->CloseWindow();
Cheers, Bertrand.

Yes, I did, and I get an exception with the code :frowning:

Well, it works for me… Can you try with one of the eve tutorials? For example:

bellenot@bellenot-virtual-machine ~/v5-34/tutorials/eve $ root -l root [0] .x triangleset.C root [1] gEve->GetBrowser()->GetMainFrame()->CloseWindow(); root [2]
Cheers, Bertrand.

It’s not working. Maybe the problem is in opening the new window.
Is there any example of opening a new window in application and then closing it? :confused:

[quote=“AryaStark”]It’s not working.[/quote]And how does it fail? Is the macro working?

[quote=“AryaStark”]Maybe the problem is in opening the new window[/quote]What do you mean?
BTW, on which system do you work? It works for me on Windows and Linux…

Cheers, Bertrand.

I’m using Win 7.

I’m compiling the code and I get this exception when I click on exit:

First-chance exception at 0x00000001 in LHCb_launcher.exe: 0xC0000005: Access violation executing location 0x00000001. Warning in <TWinNTSystem::Run>: handle uncaugth exception, terminating First-chance exception at 0x774CE3BE (ntdll.dll) in LHCb_launcher.exe: 0xC0000005: Access violation reading location 0x67639F85. Unhandled exception at 0x774CE3BE (ntdll.dll) in LHCb_launcher.exe: 0xC0000005: Access violation reading location 0x67639F85.

I am opening a new window just by running this:

Frame *f=new Frame(lang, user);

maybe I need something like this:

TApplication *app = new TApplication("New window", &argc, argv); Frame *f = new Frame(); app->Run(kTRUE); app->Terminate(0); return 0;
Would that make sense? :s

Well, that would save our time if you try what I ask… So if you need more help, please post some code reproducing the problem, or use Visual Studio to debug your code.

Cheers, Bertrand.

root [0] .x triangleset.C root [1] gEve->GetBrowser()->GetMainFrame()->CloseWindow(); root [2]

I’ve tried this, and it closes the ROOT session too.

…and I am debugging my code in Visual Studio…

I need a simple example of gui (launcher) which can open a new window.
And when a user closes that window, it can be opened again using the same launcher.

[quote=“AryaStark”]root [0] .x triangleset.C root [1] gEve->GetBrowser()->GetMainFrame()->CloseWindow(); root [2]

I’ve tried this, and it closes the ROOT session too.[/quote]Well, looking at the code you posted, it seems it is not the case…

[quote=“AryaStark”]I need a simple example of gui (launcher) which can open a new window.
And when a user closes that window, it can be opened again using the same launcher.[/quote]I will try to set-up something when I have some time.

Cheers, Bertrand.

Hi,

Here is a very simple and basic example. Hope it will help…

Cheers, Bertrand.
launcher.C (2.77 KB)