Message: Re: Finishing a G4UIterminal session Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Finishing a G4UIterminal session 

Forum: Run Management
Re: Question Finishing a G4UIterminal session (C Mos)
Re: Feedback Re: Finishing a G4UIterminal session (Michael H. Kelsey)
Re: None Re: Finishing a G4UIterminal session (C Mos)
Date: 30 May, 2013
From: Michael H. Kelsey <Michael H. Kelsey>

C Mos writes:
> Thank you for your comment. I was hoping to find something more elegant
> but that could work. However I found another way to do it, and it was
> not to create the G4UIsession in the first place. Sometimes one just
> needs to go back to basics.

Ah!  You wanted your main macro to be run, and then have your application
exit.  Yes, what you describe is the "right" solution.

In most main()s, we find something like:

 int main(int argc, char* argv[]) {
 // ... setup, RunManager, etc. goes here

   if (argc == 1) {
     G4UIExecutive ui(argc, argv);
     ui.SessionStart();
   } else {
     G4UImanager::GetUIpointer()->ExecuteMacroFile(argv[1]);
   }

 // ... program cleanup goes here ...
 }

Thus, if you pass a macro filename on the command-line, it gets executable
and then the program exits.  With no arguments, you get a UI prompt.

 -- Michael Kelsey

 Add Message Add Message
to: "Re: Finishing a G4UIterminal session"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]