Ignore:
Timestamp:
Dec 4, 2009 5:01:07 PM (11 years ago)
Author:
toby
Message:

# on 2000/05/17 20:27:05, toby did:
major edit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/expgui_cfg.html

    • Property rcs:date changed from 1999/10/11 20:27:13 to 2000/05/17 20:27:05
    • Property rcs:lines changed from +107 -3 to +93 -21
    • Property rcs:rev changed from 1.7 to 1.8
    r114 r143  
    11<HTML>
    2 <TITLE>
    3 Customizing EXPGUI and Associated Programs
    4 </TITLE>
     2   <META NAME="Author" CONTENT="Brian H. Toby">
     3   <TITLE>Customizing EXPGUI and Associated Programs</TITLE>
    54<HEAD>
    65</HEAD>
    7 <BODY>
    8 
     6<BODY BGCOLOR="#FFFFFF">
     7
     8<A HREF=http://www.ncnr.nist.gov>
     9<IMG SRC="http://www.ncnr.nist.gov/images/ncnrtrans.gif"
     10alt="Link to NIST Center for Neutron Research home page"
     11ALIGN=RIGHT></A>
     12<A HREF=http://www.nist.gov>
     13<IMG SRC="http://www.ncnr.nist.gov/images/webidblue_2lineright.gif"
     14alt="Link to National Institute of Standards & Technology home page"
     15ALIGN=LEFT></A>
    916<CENTER>
    10 <H2>
    11 Customizing EXPGUI and Associated Programs</H2></CENTER>
     17<H1>
     18Customizing EXPGUI and Associated Programs</H1></CENTER>
    1219
    1320The EXPGUI GSAS graphical user interface can be modified in many
     
    9299
    93100In addition to the variables defined in the previous file, expgui, uses
    94 a small number of array for other configuration options. They are:
     101a small number of array elements for other configuration options. They are:
    95102<DL><DL>
    96103
     
    125132Sets the default value for display of the legend in liveplot
    126133
     134<DT>expgui(initstring)<DD>
     135Defines commands to be executed by EXPGUI after all other commands
     136have been run. This is used to define initialization commands in
     137the <TT>localconfig</TT> or <TT>.gsas_config</TT> files that cannot be
     138run at the time when the files are sourced. <I>(added in EXPGUI v1.21)</I>
    127139</DL></DL>
    128140
     
    150162for the backspace key is overridden; some UNIX systems need this so that
    151163expedt and other terminal-oriented programs work correctly and
    152 other systems do not. You can toggle this option using the "sets an environment variable needed by the "Override Backspace" option on the file menu.
     164other systems do not. You can toggle this option using the
     165"Override Backspace" option on the file menu to see what works for you.
    153166
    154167</DL></DL>
     
    277290Windows</A> and
    278291<A HREF="expgui_Unix_readme.html">
    279 UNIX</A>.
     292UNIX</A>. Note that as of the April 2000 releases, GSAS is now distributed
     293with TCLDUMP.
    280294<P>
    281295<B>Combining CMPR and LIVEPLOT.</B>
     
    402416<hr>
    403417<H2>
    404 Customizing Example 2: Adding a new button to the button bar
     418Customizing Example 2: Putting DISAGL Results in a Separate Box
    405419</H2>
    406420Barbara Reisner has been asking me to put the output from DISAGL in a separate
    407 window. Sounds like a pretty reasonable request. Here is the code to do that.
    408 
     421window. Sounds like a pretty reasonable request. Here is an example with code
     422to do that as a customization option. Please note that this has now been
     423incorporated into EXPGUI, so do not use this example.
    409424<PRE>
    410425  set expgui(disaglSeparateBox) 1
     
    412427  proc rundisagl {} {
    413428    global expgui txtvw tcl_version tcl_platform
    414     if {$expgui(disaglSeparateBox)} {
     429    if {$expgui(disaglSeparateBox) && $tcl_platform(platform) != "windows"} {
    415430        set root [file root $expgui(expfile)]
    416431        catch {file rename $root.LST $root.OLS}
     
    456471  }
    457472
     473if {$tcl_platform(platform) != "windows"} {
     474  append expgui(initstring) {
     475      $expgui(fm).option.menu add checkbutton  -label "DISAGL window" \
     476              -variable expgui(disaglSeparateBox) -underline 0;
     477  }
     478}
     479
    458480</PRE>
    459481To make this customization, put the above in the <TT>localconfig</TT>
     
    462484file.
    463485<P>
    464 Note that an even better customization might be to add these commands into
    465 the expgui file somewhere near the beginning and then near the end,
    466 add
    467 <PRE>
    468    $expgui(fm).option.menu add checkbutton  -label "DISAGL window" \
    469         -variable expgui(disaglSeparateBox) -underline 0
    470 </PRE>
    471 so that there is an option to turn the "separate DISAGL window mode"
    472 on and off.
     486Note that the <tt>expgui(initstring)</tt> option became available in EXPGUI
     487version 1.21. (Previous versions will ignore this). This code must be executed
     488after all the menus and other GUI code has been run. When executed, it
     489creates a checkbutton on the Options menu to
     490turn the "separate DISAGL window mode" mode on and off.
     491
     492<hr><H2>
     493Customizing Example 3: Adding a new page to EXPGUI
     494</H2>
     495The steps for creating support for additional functionality, implementation
     496of atom constraints, is outlined here. Routines described here can be found in
     497file <tt>atomcons.tcl</tt> unless otherwise noted.
     498<OL>
     499<LI>Create a routine to read and write the appropriate records
     500from the .EXP file. In this case, a new routine, constrinfo,
     501was added to file <tt>readexp.tcl</tt>.
     502This takes considerable care and manual testing.
     503<LI>Create a routine that places the appropriate widgets into a frame
     504(in this case MakeAtomsConstraintsPane). This routine will be called only once.
     505Note that in this example expcons(atommaster) is defined to be the name of the
     506frame.
     507<LI>Create a routine to display and edit the information shown in the
     508frame. In this case, DisplayAtomConstraints. This routine will be called each
     509time the page is displayed. Note that this routine and the previous can be
     510tested in a separate toplevel until they work well.
     511<LI>In this particular example, the previous frame is located on a notebook
     512widget that in turn placed on a notebook page, so MakeConstraintsPane is used
     513to create this inner notebook when the "Constraints" notebook page is first
     514shown. This in turn calls MakeAtomsConstraintsPane and DisplayAtomConstraints.
     515No routine is needed to update this page each time the page
     516is displayed.
     517<LI>Edit file <tt>expgui</tt> to make the following changes:
     518<UL>
     519<P><LI>load the <tt>atomcons.tcl</tt> file:
     520<PRE>
     521# commands for costraints
     522source [file join $expgui(scriptdir) atomcons.tcl]
     523</PRE>
     524<P><LI>Define a notebook page for the option. The -createcmd option
     525is used only once, but the -raisecmd option is used every time
     526the page is exposed.
     527<PRE>
     528set expgui(consFrame) [\
     529            .n insert end consPane -text Constraints \
     530            -raisecmd "set expgui(pagenow) consFrame"\
     531            -createcmd MakeConstraintsPane]
     532</PRE>
     533Note that if we were displaying the atoms constraint page directly on
     534the main notebook widget, the previous command would have been
     535<tt>-raisecmd DisplayAtomConstraints -createcmd MakeAtomsConstraintsPane</tt>
     536<P>
     537If the frame will need to be updated when histogram information changes,
     538add the name of the frame and a command to execute into string
     539expgui(frameactionlist), for example:
     540<PRE>
     541    lappend expgui(frameactionlist) "consFrame DisplayConstraints"
     542</PRE>
     543</UL>
     544</OL>
    473545<hr>
    474546GSAS is written by Allen C. Larson and <A HREF="http://www.nist.gov/cgi-bin/exit_nist.cgi?url=http://lansce.lanl.gov/lujan/staff12/vondreele.htm">
Note: See TracChangeset for help on using the changeset viewer.