Skip to content

Commit 0d5f382

Browse files
committed
[main] rootbrowse: instance a TRint instead of TApplication
This gives 2 advantages: it executes .rootlogon.C on startup (like the old rootbrowse did) and it provides an interactive prompt to the user while using rootbrowse. (cherry picked from commit f913676)
1 parent 9ed48aa commit 0d5f382

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main/src/rootbrowse.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/// \date 2025-08-21
77
#include <ROOT/RLogger.hxx>
88

9-
#include <TApplication.h>
9+
#include <TRint.h>
1010
#include <TBrowser.h>
1111
#include <TError.h>
1212
#include <TFile.h>
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
134134

135135
// NOTE: we need to instantiate TApplication ourselves, otherwise TBrowser
136136
// will create a batch application that cannot show graphics.
137-
TApplication app("rootbrowse", nullptr, nullptr);
137+
TRint app("rootbrowse", nullptr, nullptr);
138138

139139
if (!args.fWeb.empty())
140140
gROOT->SetWebDisplay(std::string(args.fWeb).c_str());
@@ -157,11 +157,11 @@ int main(int argc, char **argv)
157157
// For classic graphics: ensure rootbrowse quits when the window is closed
158158
if (auto imp = browser->GetBrowserImp()) {
159159
if (auto mainframe = imp->GetMainFrame()) {
160-
mainframe->Connect("CloseWindow()", "TApplication", &app, "Terminate()");
160+
mainframe->Connect("CloseWindow()", "TRint", &app, "Terminate()");
161161
}
162162
}
163163

164-
std::cout << "Press ctrl+c to exit.\n";
164+
std::cout << ".q to exit.\n";
165165
while (!gROOT->IsInterrupted() && !gSystem->ProcessEvents()) {
166166
std::this_thread::sleep_for(std::chrono::milliseconds(10));
167167
}

0 commit comments

Comments
 (0)