Changeset 659


Ignore:
Timestamp:
Dec 13, 2007, 3:32:24 PM (17 years ago)
Author:
garnier
Message:

modif pour faire un .app sur MAC OSX

Location:
trunk/geant4/N03
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/N03/.DAWN_1.history

    r609 r659  
    1 103078
     1885739
     235
     335
    240
    3 0
    4 0
    5 0
    6 0
    7 0
    8 1
     510.6007
     6-11.7529
     711.7529
     81.1
    991
    10100.001
  • trunk/geant4/N03/exampleN03.cc

    r609 r659  
    4747#include "ExN03SteppingVerbose.hh"
    4848
     49/** Environnement definition for app launch for mac
     50 */
     51
     52#define MOSX_APP
     53
     54#ifdef MOSX_APP
     55#define G4UI_BUILD_QT_SESSION
     56#define G4VIS_BUILD_OPENGLQT_DRIVER
     57#include <qfiledialog.h>
     58#endif
     59
     60/** End of Environnement definition for app launch for mac
     61 */
     62
    4963#ifdef G4VIS_USE
    5064#include "G4VisExecutive.hh"
     
    114128  G4UImanager* UI = G4UImanager::GetUIpointer();     
    115129 
     130#ifndef MOSX_APP
    116131  if (argc!=1)   // batch mode
    117132    {
     
    122137  else           // interactive mode : define visualization UI terminal
    123138    {
     139#endif
     140
    124141#ifdef G4VIS_USE
    125142      G4VisManager* visManager = new G4VisExecutive;
     
    138155#elif defined(G4UI_USE_QT)
    139156      session = new G4UIQt(argc,argv);
    140       UI->ApplyCommand("/control/execute visTutor/gui.mac");     
     157#ifdef MOSX_APP
     158      G4String gui = (QString("/control/execute ") +
     159                      QFileDialog::getOpenFileName(NULL,"Open gui.mac File",
     160                                                   "../Resources",
     161                                                   "gui.mac")).toStdString().c_str();
     162     
     163#else
     164      G4String gui = "/control/execute visTutor/gui.mac"; 
     165#endif
     166      UI->ApplyCommand(gui);     
    141167#else
    142168      session = new G4UIterminal();
    143169#endif
    144170
    145       UI->ApplyCommand("/control/execute vis.mac");
     171#ifdef MOSX_APP
     172      G4String vis = (QString("/control/execute ") +
     173                      QFileDialog::getOpenFileName(NULL,"Open vis.mac File",
     174                                                   "../Resources",
     175                                                   "vis.mac")).toStdString().c_str();
     176#else
     177      G4String vis = "/control/execute vis.mac"; 
     178#endif
     179      UI->ApplyCommand(vis);
    146180      session->SessionStart();
    147181      delete session;
     
    150184      delete visManager;
    151185#endif               
     186
     187#ifndef MOSX_APP
    152188    }
     189#endif
    153190
    154191  // Job termination
Note: See TracChangeset for help on using the changeset viewer.