Ignore:
Timestamp:
Nov 5, 2010, 4:03:47 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/novice/N03/exampleN03.cc

    r1337 r1341  
    5252#include "G4UIExecutive.hh"
    5353#endif
     54
     55#include "qcoreapplication.h"
     56
     57#define MAC_OSX_APP 1
    5458
    5559//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    107111  //
    108112  G4UImanager* UImanager = G4UImanager::GetUIpointer();
    109  
     113   
     114#ifdef MAC_OSX_APP
     115  std::string progName = argv[0];
     116  std::string::size_type pos = progName.find(".app/Contents/MacOS/",0);
     117  if (pos != std::string::npos) {
     118    std::string progDir = progName.substr(0,pos+4);
     119    chdir((progDir+"/Contents/macros").c_str());
     120    argc = 1;
     121  }
     122#endif
     123
    110124  if (argc!=1)   // batch mode
    111125    {
    112       G4String command = "/control/execute ";
     126     G4String command = "/control/execute ";
    113127      G4String fileName = argv[1];
    114128      UImanager->ApplyCommand(command+fileName);   
Note: See TracChangeset for help on using the changeset viewer.