Changeset 1212


Ignore:
Timestamp:
Dec 10, 2009, 5:04:53 PM (14 years ago)
Author:
garnier
Message:

update doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/graphicalUserInterface.xml

    r921 r1212  
    22<!--                                                          -->
    33<!--  [History]                                               -->
     4<!--    Update G4UIExecutive : Laurent Garnier, Dec-2009      -->
    45<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
    56<!--                                                          -->
     
    6566  </para></listitem>
    6667  <listitem><para>
    67   Xm, Xaw, Win32, variations of the upper terminal by using a
    68   Motif, Athena or Windows widget to retrieve commands, and
     68  Xm, Xaw, Win32, Qt variations of the upper terminal by using a
     69  Motif, Athena, Qt or Windows widget to retrieve commands, and
    6970  </para></listitem>
    7071  <listitem><para>
     
    225226<sect3 id="sect.HowToSetUpInter.DescInter.G4UIXm">
    226227<title>
    227 <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis> and
     228<emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis>, <emphasis>G4UIQt</emphasis> and
    228229<emphasis>G4UIWin32</emphasis> classes
    229230</title>
     
    231232<para>
    232233These interfaces are versions of <emphasis>G4UIterminal</emphasis>
    233 implemented over libraries Motif, Athena and WIN32 respectively.
     234implemented over libraries Motif, Athena, Qt and WIN32 respectively.
    234235<emphasis>G4UIXm</emphasis> uses the Motif XmCommand widget,
    235236<emphasis>G4UIXaw</emphasis> the Athena dialog
     237widget, <emphasis>G4UIQt</emphasis> the Qt dialog
    236238widget, and <emphasis>G4UIWin32</emphasis> the Windows "edit" component to do the
    237239command capturing. These interfaces are useful if working in
    238 conjunction with visualization drivers that use the Xt library or
     240conjunction with visualization drivers that use the Xt library, Qt library or
    239241the WIN32 one.
    240242</para>
     
    278280<para>
    279281<emphasis>G4UIXm</emphasis> runs on Unix/Linux with Motif. <emphasis>G4UIXaw</emphasis>,
    280 less user friendly, runs on Unix with Athena widgets.
     282less user friendly, runs on Unix with Athena widgets. <emphasis>G4UIQt</emphasis> run
     283everywhere with Qt.
    281284<emphasis>G4UIWin32</emphasis> runs on Windows.
    282285</para>
     
    400403
    401404<para>
    402 To make the libraries of <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis> and
     405To make the libraries of <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis>,
     406 <emphasis>G4UIQt</emphasis> and
    403407<emphasis>G4UIWin32</emphasis> , respective environment variables
    404408<emphasis role="bold">G4UI_BUILD_XM_SESSION</emphasis>,
    405 <emphasis role="bold">G4UI_BUILD_XAW_SESSION</emphasis> or
     409<emphasis role="bold">G4UI_BUILD_XAW_SESSION</emphasis>,
     410<emphasis role="bold">G4UI_BUILD_QT_SESSION</emphasis> or
    406411<emphasis role="bold">G4UI_BUILD_WIN32_SESSION</emphasis> must be set
    407412explicitly before creating libraries.
     
    430435<para>
    431436To use a given interface
    432 (<literal>G4UIxxx</literal> where <literal>xxx = terminal,Xm, Xaw, Win32,
    433 GAG, GainServer</literal>) in your program, you have  following
    434 lines in your main program;
    435 
    436 <informalexample>
    437 <programlisting>
    438 // to include the class definition in the main program:
     437(<literal>G4UIxxx</literal> where <literal>xxx = terminal,Xm, Xaw, Win32, Qt,
     438GAG, GainServer</literal>) in your program, you can do it by two ways :
     439<itemizedlist spacing="compact">
     440   <listitem><para> Calling G4UIxxx directly :
     441   <informalexample>
     442   <programlisting>
    439443   #include "G4Uixxx.hh"
    440444// to instantiate a session of your choice and start the session
     
    443447// the line next to the "SessionStart" is necessary to finish the session
    444448   delete session;
     449   </programlisting>
     450   </informalexample>
     451   Note : For a tcsh session, the second line must be (See the examples in "examples/novice/N0x" in which the terminal session is used) :
     452
     453   <informalexample>
     454   <programlisting>
     455      G4UIsession* session = new G4UIterminal(new G4UItcsh);
     456   </programlisting>
     457   </informalexample>
     458   
     459   </para></listitem>
     460   <listitem><para>Using <emphasis>G4UIExecutive</emphasis> (implement in all novice examples) :
     461     <informalexample>
     462     <programlisting>
     463// to include the class definition in the main program:
     464   #ifdef G4UI_USE
     465     #include "G4UIExecutive.hh"
     466   #endif
     467// to instantiate a session of your choice and start the session
     468   #ifdef G4UI_USE
     469     G4UIExecutive* ui = new G4UIExecutive(argc,argv);
     470     ui-&gt;SessionStart();
     471// the line next to the "SessionStart" is necessary to finish the session
     472     delete ui;
     473   #endif
     474     </programlisting>
     475     </informalexample>
     476</para>
     477</listitem>
     478</itemizedlist>
     479</para>
     480
     481<para>The two methods are similar. If you want to choose between several viewer driver at load, with the <emphasis>first</emphasis> method you will have to write :
     482<informalexample>
     483<programlisting>
     484// to include the class definition in the main program:
     485   #if defined(G4UI_USE_TCSH)
     486     #include "G4UIterminal.hh"
     487     #include "G4UItcsh.hh"
     488   #elif defined(G4UI_USE_XM)
     489     #include "G4UIXm.hh"
     490   ....
     491   #endif
     492
     493   #if defined(G4UI_USE_TCSH)
     494     session = new G4UITerminal(new G4UITerminal);
     495   #elif defined(G4UI_USE_XM)
     496     session = new G4UIXm(argc,argv);
     497   #elif ...
    445498</programlisting>
    446499</informalexample>
    447 </para>
    448 
    449 <para>
    450 For a tcsh session, the second line must be :
    451 
     500That is not realy simple. The best way to do this is the <emphasis>second</emphasis> method :
    452501<informalexample>
    453502<programlisting>
    454    G4UIsession* session = new G4UIterminal(new G4UItcsh);
     503   #ifdef G4UI_USE
     504     #include "G4UIExecutive.hh"
     505   #endif
     506...
     507
     508// to instantiate a session of your choice and start the session
     509// G4UIExecutive will open for you the good driver (depending on G4UI_USE_xxx flags)
     510   #ifdef G4UI_USE
     511     G4UIExecutive* ui = new G4UIExecutive(argc,argv);
     512   #endif
    455513</programlisting>
    456514</informalexample>
    457 </para>
    458 
    459 <para>
    460 See the examples in "examples/novice/N0x" in which the terminal session
    461 is used.
    462 </para>
    463 
     515
     516</para>
    464517<para>
    465518If the user wants to deactivate the default signal handler (soft abort)
     
    499552   <listitem><para>
    500553   The environment variable <emphasis role="bold">G4UI_USE_XM</emphasis>,
    501    <emphasis role="bold">G4UI_USE_XAW</emphasis> or
     554<emphasis role="bold">G4UI_USE_QT</emphasis>,   <emphasis role="bold">G4UI_USE_XAW</emphasis> or
    502555   <emphasis role="bold">G4UI_USE_WIN32</emphasis> must be set to use the
    503    respective interface. The file "$G4INSTALL/config/interactivity.gmk"
     556   respective interface. The file "$G4INSTALL/config/G4UI_USE.gmk"
    504557   resolves their dependencies on external packages.
    505558   </para></listitem>
Note: See TracChangeset for help on using the changeset viewer.