Changeset 1212 for trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/graphicalUserInterface.xml
- Timestamp:
- Dec 10, 2009, 5:04:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/GettingStarted/graphicalUserInterface.xml
r921 r1212 2 2 <!-- --> 3 3 <!-- [History] --> 4 <!-- Update G4UIExecutive : Laurent Garnier, Dec-2009 --> 4 5 <!-- Converted to DocBook: Katsuya Amako, Aug-2006 --> 5 6 <!-- --> … … 65 66 </para></listitem> 66 67 <listitem><para> 67 Xm, Xaw, Win32, variations of the upper terminal by using a68 Motif, Athena or Windows widget to retrieve commands, and68 Xm, Xaw, Win32, Qt variations of the upper terminal by using a 69 Motif, Athena, Qt or Windows widget to retrieve commands, and 69 70 </para></listitem> 70 71 <listitem><para> … … 225 226 <sect3 id="sect.HowToSetUpInter.DescInter.G4UIXm"> 226 227 <title> 227 <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis> and228 <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis>, <emphasis>G4UIQt</emphasis> and 228 229 <emphasis>G4UIWin32</emphasis> classes 229 230 </title> … … 231 232 <para> 232 233 These interfaces are versions of <emphasis>G4UIterminal</emphasis> 233 implemented over libraries Motif, Athena and WIN32 respectively.234 implemented over libraries Motif, Athena, Qt and WIN32 respectively. 234 235 <emphasis>G4UIXm</emphasis> uses the Motif XmCommand widget, 235 236 <emphasis>G4UIXaw</emphasis> the Athena dialog 237 widget, <emphasis>G4UIQt</emphasis> the Qt dialog 236 238 widget, and <emphasis>G4UIWin32</emphasis> the Windows "edit" component to do the 237 239 command capturing. These interfaces are useful if working in 238 conjunction with visualization drivers that use the Xt library or240 conjunction with visualization drivers that use the Xt library, Qt library or 239 241 the WIN32 one. 240 242 </para> … … 278 280 <para> 279 281 <emphasis>G4UIXm</emphasis> runs on Unix/Linux with Motif. <emphasis>G4UIXaw</emphasis>, 280 less user friendly, runs on Unix with Athena widgets. 282 less user friendly, runs on Unix with Athena widgets. <emphasis>G4UIQt</emphasis> run 283 everywhere with Qt. 281 284 <emphasis>G4UIWin32</emphasis> runs on Windows. 282 285 </para> … … 400 403 401 404 <para> 402 To make the libraries of <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis> and 405 To make the libraries of <emphasis>G4UIXm</emphasis>, <emphasis>G4UIXaw</emphasis>, 406 <emphasis>G4UIQt</emphasis> and 403 407 <emphasis>G4UIWin32</emphasis> , respective environment variables 404 408 <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 406 411 <emphasis role="bold">G4UI_BUILD_WIN32_SESSION</emphasis> must be set 407 412 explicitly before creating libraries. … … 430 435 <para> 431 436 To 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, 438 GAG, 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> 439 443 #include "G4Uixxx.hh" 440 444 // to instantiate a session of your choice and start the session … … 443 447 // the line next to the "SessionStart" is necessary to finish the session 444 448 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->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 ... 445 498 </programlisting> 446 499 </informalexample> 447 </para> 448 449 <para> 450 For a tcsh session, the second line must be : 451 500 That is not realy simple. The best way to do this is the <emphasis>second</emphasis> method : 452 501 <informalexample> 453 502 <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 455 513 </programlisting> 456 514 </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> 464 517 <para> 465 518 If the user wants to deactivate the default signal handler (soft abort) … … 499 552 <listitem><para> 500 553 The environment variable <emphasis role="bold">G4UI_USE_XM</emphasis>, 501 <emphasis role="bold">G4UI_USE_XAW</emphasis> or554 <emphasis role="bold">G4UI_USE_QT</emphasis>, <emphasis role="bold">G4UI_USE_XAW</emphasis> or 502 555 <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" 504 557 resolves their dependencies on external packages. 505 558 </para></listitem>
Note: See TracChangeset
for help on using the changeset viewer.