source: trunk/doc/expgui_cfg.html @ 654

Last change on this file since 654 was 574, checked in by toby, 12 years ago

# on 2002/04/12 19:49:04, toby did:
remove identification stuff

  • Property rcs:author set to toby
  • Property rcs:date set to 2002/04/12 19:49:04
  • Property rcs:lines set to +6 -5
  • Property rcs:rev set to 1.24
  • Property rcs:state set to Exp
  • Property svn:keywords set to Author Date Revision Id
File size: 28.9 KB
[143]2   <TITLE>Customizing EXPGUI and Associated Programs</TITLE>
4   <meta name="keywords" content="crystallography, Rietveld, diffraction,
8A:link {text-decoration:none}
9A:vlink {text-decoration:none}
13      topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" 
14      text="#000000" link="#0033ff" vlink="#0033ff" alink="#0033ff">
17   include("/var/www/include/");
18   include("/var/www/include/");
20<blockquote><font face="arial, helvetica, sans-serif">
23<TR><TH><A  Href="expgui.html">EXPGUI top</A> 
27<HR noshade width="75%" size="2" align="center">
28Customizing EXPGUI and Associated Programs
29<HR noshade width="75%" size="2" align="center">
32The EXPGUI GSAS graphical user interface can be modified in many
33ways quite easily.
34This document describes how the GUI works and how to modify the menus without
[144]35significant reprogramming. A little bit of programming in Tcl/Tk can go a
[114]36long way in adding new features. See the
37<a HREF="#Customizing">Customizing</A> examples, below.
[36]40The main GUI is created by file expgui, which in turn uses the following files
[550]43<LI><FONT FACE="COURIER">readexp.tcl</FONT>
44<LI><FONT FACE="COURIER">gsascmds.tcl</FONT>
45<LI><FONT FACE="COURIER">gsasmenu.tcl</FONT>
47Two additional files are read if they are found:
[550]49<LI><FONT FACE="COURIER">localconfig</FONT>
50<LI><FONT FACE="COURIER">.gsas_config</FONT>
52<P>The first three files,
[550]53(<FONT FACE="COURIER">readexp.tcl</FONT>, <FONT FACE="COURIER">gsascmds.tcl</FONT>, <FONT FACE="COURIER">gsasmenu.tcl</FONT>)
54must be located in the same directory where the <FONT FACE="COURIER">expgui</FONT> file is found.
55The <FONT FACE="COURIER">localconfig</FONT> file also is read from this directory, if it exists.
56The final file, <FONT FACE="COURIER">.gsas_config</FONT>, is read from the user's login directory (UNIX) or <FONT FACE="COURIER">C:\</FONT> (Windows).
57The <FONT FACE="COURIER">localconfig</FONT> and <FONT FACE="COURIER">.gsas_config</FONT> are intended to
[41]58contain system-wide and user-level default values for parameters
59that are described in this document. Most routines have
60a "Save Options" command that writes some of the current parameters to
[550]61file  <FONT FACE="COURIER">.gsas_config</FONT>. Note that information in <FONT FACE="COURIER">.gsas_config</FONT>
62overrides that in <FONT FACE="COURIER">localconfig</FONT>.
[41]63No error occurs if either of these files are not found.
[550]66The <FONT FACE="COURIER">readexp.tcl</FONT> and <FONT FACE="COURIER">gsascmds.tcl</FONT> files contain
[36]67tcl procedures that are
68used for more than one application, so it is convenient to place them
69in separate files. They are only of interest to someone trying to debug
70or add new functionality to expgui.
[550]72The <FONT FACE="COURIER">gsasmenu.tcl</FONT> file defines the contents of the
[36]73menu bar, the contents of the
74button bar and definitions for each command. The contents of this file
75are designed to be modified and extended by users, either by editing the file,
[550]76or by overriding definitions in the <FONT FACE="COURIER">localconfig</FONT> or
77<FONT FACE="COURIER">.gsas_config</FONT> files.
[550]79The important variables defined in the <FONT FACE="COURIER">gsasmenu.tcl</FONT> file are:
[550]81<DT><FONT FACE="COURIER">expgui(menunames)</FONT><DD>
[36]82This list defines the menu bar headings other than File, Options & Help
[550]83<DT><FONT FACE="COURIER">expgui_menulist</FONT><DD>
[36]84Each array element, e.g. expgui_menulist(file) and expgui_menulist(powder),
85defines commands to be added to a menu heading. Each command will appear
86as an array element in expgui_cmdlist.
[550]87<DT><FONT FACE="COURIER">expgui_cmdlist</FONT><DD>
[36]88Each array element, e.g. expgui_cmdlist(Save) or expgui_cmdlist(expnam)
89contains two items. The first defines a tcl procedure to be executed
90when the command is invoked, or "-" if no command will be invoked and
91the second contains help information describing what the command does.
92Note that when menu item is selected the variable cmd is set to the
93name of the command, so
[36]95    expgui_cmdlist(powpref) {{runGSASwEXP $cmd} {Powder data preparation}}
[36]97means that "runGSASwEXP powpref" will be invoked when powpref is invoked.
[524]98For example, when powpref is selected, the tcl command
[36]99"runGSASwEXP $cmd" is invoked, where variable cmd is set to "powpref".
[550]100<DT><FONT FACE="COURIER">expgui(buttonlist)</FONT><DD>
[36]101This list defines the commands that will appear on the button bar where
102each item that appears on the button bar must have a matching pair of entries
103in expgui_cmdlist.
104Thus if the command
[36]106   set expgui(buttonlist) {expnam expedt genles ortep fourier forsrh forplot lstview}
108is placed in the <FONT FACE="COURIER">localconfig</FONT> or <FONT FACE="COURIER">.gsas_config</FONT> files this will
[36]109redefine the contents of the button bar.
112In addition to the variables defined in the previous file, expgui, uses
[143]113a small number of array elements for other configuration options. They are:
[550]116<DT><FONT FACE="COURIER">expgui(scriptdir)</FONT><DD>
117This determines where files such as <FONT FACE="COURIER">readexp.tcl</FONT>, etc.
118are located. This defaults to the location where <FONT FACE="COURIER">expgui</FONT> is located so
[41]119it rarely needs to be changed.
[550]121<DT><FONT FACE="COURIER">expgui(gsasdir)</FONT><DD>
[41]122This contains the location of the GSAS directory, if it is not the
123parent director where expgui is found.
124This determines where a number of GSAS data files will be located. If expedt
125crashes when you try to add new atoms, this is probably wrong.
[550]127<DT><FONT FACE="COURIER">expgui(gsasexe)</FONT><DD>
[36]128This determines where the GSAS executable files are located.
129You might want to change this is you keep multiple versions of GSAS
130around or if you keep the GSAS files in a different location than
131the default or want to keep the tcl files somewhere other than
132in a subdirectory of the GSAS files.
[550]134<DT><FONT FACE="COURIER">expgui(bkgcolor1)</FONT><DD>
[307]135Sets the background color for the bottom box on the phase pane.
136The default value, #fdf, is a light violet that
137will probably drive some folks nuts, but is a good contrast to the yellow
138of the refinement flags.
[550]140<DT><FONT FACE="COURIER">liveplot(hst)</FONT><DD>
[41]141Sets the default histogram used for liveplot
[550]143<DT><FONT FACE="COURIER">liveplot(legend)</FONT><DD>
[41]144Sets the default value for display of the legend in liveplot
[550]146<DT><FONT FACE="COURIER">expgui(initstring)</FONT><DD>
[143]147Defines commands to be executed by EXPGUI after all other commands
148have been run. This is used to define initialization commands in
[550]149the <FONT FACE="COURIER">localconfig</FONT> or <FONT FACE="COURIER">.gsas_config</FONT> files that cannot be
[143]150run at the time when the files are sourced. <I>(added in EXPGUI v1.21)</I>
[550]153The following variables are written to <font face="courier">.gsas_config</font> when
[41]154"Save Options" is used. These variables are all set from the GUI and therefore
155do not need to be edited manually.
[550]158<DT><FONT FACE="COURIER">expgui(archive)</FONT><DD>
[41]159This defines the default state for the archive flag,
160where 0 is off and 1 is on. When archive is on, a copy of the .EXP file
[461]161is saved before a new version of the file is saved in EXPGUI.
[550]163<DT><FONT FACE="COURIER">expgui(font)</FONT><DD>
[423]164This determines the base font used in the programs. You conceivably
165could want to use an integer value not present in the
166"Options/Screen Font" menu command.
[550]168<DT><FONT FACE="COURIER">expgui(asorttype)</FONT><DD>
[41]169This determines the atom sort mode.
[550]171<DT><FONT FACE="COURIER">expgui(hsorttype)</FONT><DD>
[41]172This determines the histogram sort mode.
[550]174<DT><FONT FACE="COURIER">expgui(filesort)</FONT><DD>
[81]175This determines the default file sorting mode for the expnam command.
[550]177<DT><FONT FACE="COURIER">expgui(autoexpload)</FONT><DD>
[314]178If set to 1, the experiment file is automatically reread after
179GSAS programs modify it.
180(UNIX only)
[550]182<DT><FONT FACE="COURIER">expgui(showexptool)</FONT><DD>
[314]183If set to 1, output from EXPTOOL is shown after the program is run.
184This is probably needed only for debugging purposes.
[41]187Used only for UNIX: This determines if the default definition
[36]188for the backspace key is overridden; some UNIX systems need this so that
189expedt and other terminal-oriented programs work correctly and
[143]190other systems do not. You can toggle this option using the
191"Override Backspace" option on the file menu to see what works for you.
196<HR><H3><A NAME="import">Coordinate import routines for EXPGUI</A>
[299]197<IMG SRC="new.gif" HEIGHT=13 WIDTH=36 alt="New!">
[524]199See the <A HREF="expgui.html#import">coordinate import discussion</A> 
200for description of available formats.
[270]201It is possible to define new formats for EXPGUI to use for importing
[524]202phase/coordinate information. This is done by creating a file
203containing the appropriate Tcl code to read this file type.
204All that is needed to cause the code to be incorporated into
205EXPGUI is to name it
[550]206<FONT FACE="COURIER">import_</FONT><I>xxxx</I><FONT FACE="COURIER">.tcl</FONT> (where <I>xxxx</I> is arbitrary)
[524]207and place it in the EXPGUI directory. All files with
208such names are read when EXPGUI is started.
[550]210The <FONT FACE="COURIER">import_</FONT> file must contain four items:
213A description for the type of file to be read.
[270]216set description "PowderCell .CEL file"
[282]219The text should not be too long, but use a return (\n) if needed:
[270]221set description "My favorite coordinate\nfile from the GIGO pkg"
[282]223This description text shows up on the button for selecting a format.
[282]226A list of preferred file extensions.
[270]228set extensions .cel
[270]232set extensions {.jnk .junk}
[282]234In UNIX upper and lower case
235versions will be generated automatically, so do not worry about
236the case of the extension. Note that "*" (all files) is always added as well.
239The name of the routine that will read the data file
[270]241set procname ReadPowderCellFile
244A routine that takes the file name as an argument
[270]246proc ReadPowderCellFile {filename} {
[282]248and returns a list containing the following four items
[282]250<P><LI>Space Group
252The space group should be named and spaced appropriately for GSAS,
253e.g. P 21/c or P 21 21 21, not P21/c or P212121.
[282]255Note that GSAS requires that if a center of symmetry is present,
256this center defines the origin (Origin 2 settings, where more than one setting
257is given in the International Tables).
258<P><LI>Cell parameters
260All six parameters should be specified in a list
[282]262<P><LI>Atom Coordinates
264The atom coordinates should be specified as a list with a list element
265for each atom.
266The list contains the following items:
268<LI>Atom label
272<LI>Atom type
276If an item is not specified, it is left blank in the atom table, except for
277Occupancy and U<sub>iso</sub>, which default to 1.0 and 0.025, respectively.
278However, one must specify a null value, if an item will be skipped over.
279For example, use:
[270]281    "Li1 0 0 0 li 0.5"
[270]285    "{} 0 0 0 li 0.5"
[270]287but not
[270]289    "0 0 0 li 0.5"
[282]293<P><LI>Warning Message (optional)
295The warning message is displayed at the bottom of the
296Replace Atoms and Add Atoms box after the file is read. This can be used
297to warn the user about problems reading the file, for example if
298the space group symbol needs attention.
[550]301See the file <FONT FACE="COURIER">import_cell.tcl</FONT> as an example for how this code
[524]302is written.
[524]305<HR><H3><A NAME="export">Coordinate Export routines for EXPGUI</A>
306<IMG SRC="new.gif" HEIGHT=13 WIDTH=36 alt="New!">
308See the <A HREF="expgui.html#export">coordinate export discussion</A> 
309for description of available formats.
310It is possible to define new formats for EXPGUI to use for exporting
311phase/coordinate information. This is done by creating a file
312containing the appropriate Tcl code to read this file type.
313All that is needed to cause the code to be incorporated into
314EXPGUI is to name it
[550]315<FONT FACE="COURIER">export_</FONT><I>xxxx</I><FONT FACE="COURIER">.tcl</FONT> (where <I>xxxx</I> is arbitrary)
[524]316and place it in the EXPGUI directory. All files with
317such names are read when EXPGUI the Import/Export=>"Coord Export" submenu
318is first invoked.
[550]320The <FONT FACE="COURIER">export_</FONT> file must define two variables:
323This defines the text that appears on the submenu. For example:
[524]325        set label "MSI .xtl format"
328This defines the Tcl routine that will be used to
[524]330        set action exp2xtl
[550]333See the file <FONT FACE="COURIER">export_example.example</FONT>, as well as the
334<FONT FACE="COURIER">export_*.tcl</FONT> files
[524]335as examples for how this
336sort of routine is written.
[550]339The <FONT FACE="COURIER">localconfig</FONT> and <FONT FACE="COURIER">.gsas_config</FONT> files are read, if present.
[41]340The following options are available for customization in these files:
[550]342<DT><FONT FACE="COURIER">txtvw(menulength)</FONT><DD>
[41]343This limits the number of entries that can
[36]344exist in a menu. For example, the default is 25, so when more than 25 cycles
345are found in a .LST file, only the last 25 are listed in the
346"Go To"/cycle submenu.
[550]347<DT><FONT FACE="COURIER">txtvw(maxchars)</FONT><DD>
[41]348This limits the maximum number of
[36]349characters that will be read from an existing .LST file to speed
[41]350the start of the program. The default is ~1Mb
[36]351for UNIX systems and ~200K for Windows.
[550]352<DT><FONT FACE="COURIER">txtvw(plotvars)</FONT><DD>
[524]353If txtvx(plotvars) is 1, a plot window is created for plotting of
354R-factors and parameter shifts as a function of cycle number.
355Note that the summary of shifts must be displayed, in order
356to plot parameter shifts. If this variable is set to 0, the
357plot window is not created and LSTVIEW runs a bit faster.
[550]360The following variables are written to <font face="courier">.gsas_config</font> when
[81]361"Save Options" is used. These variables can be set from the GUI and therefore
362do not need to be edited manually.
[550]365<DT><FONT FACE="COURIER">txtvw(followcycle)</FONT><DD>
[41]366This sets the initial value for the
367"Auto Advance" button in the "Go To" menu. When this is true,
368the program will show the last cycle in the file. As new cycles are
369added, the "view" is advanced.
[550]371<DT><FONT FACE="COURIER">txtvw(font)</FONT><DD>
[81]372This sets the font used for LSTVIEW. See documentation on the font command in
373Tk for details on font naming.
376<hr><H3>LIVEPLOT</H3><A NAME="liveplot"></A>
[410]377A description of the customization options for LIVEPLOT can be
378found in the
379<A HREF="liveplot.html#customize">
380LIVEPLOT description</A>.
[524]384<a name="WIDPLT"></a>
[36]386The widplt script is used to display the FWHM for one or more histograms
[41]387from a .EXP file.
388At this point it only works for CW data.
389It is often convenient to add for reference the expected
[36]390instrumental curves as options to the menu. This can be done by creating a
391file called widplot_<i>name</i>. For example, renaming the
[550]392<font face="courier">example_widplt_BT1</font> file supplied with the distribution to
393<font face="courier">widplt_BT1</font> will cause the FWHM curves for the NIST BT-1 instrument
[36]394to be added to the menu of defined FWHM values.
396Creating such a file is easy. To add a entry define the following
397five array elements using a single, unique element name and then append that
398element name to variable datalist.
[36]401    set UVWP(Ge15) {398.5 -343.2  163.0 0}
402    set XY(Ge15) {0 0}
403    set wave(Ge15) 2.0775
404    set lblarr(Ge15) "BT-1 Ge(311) 15'"
405    set ttrange(Ge15) "5 160"
406    lappend datalist Ge15
[36]408Array element UVWP(item) contains the (Gaussian) GU, GV, GW and GP values,
[41]409while XY(item) contains the (Lorentzian) LX and LY terms. Array element
[36]410wave(item) contains a wavelength, array element lblarr(item) contains
411the text to be shown on the "Plot Contents" menu and ttrange(item)
412defines the range the function is valid.
[550]414The following variables are written to <font face="courier">.gsas_config</font> when
[41]415"Save Options" is used. These variables are all set from the GUI and therefore
416do not need to be edited manually.
[550]419<DT><FONT FACE="COURIER">graph(printout)</FONT><DD>
[41]420This is set to 1 if PostScript files
421will be printed and 0 if they will be written to disk (for Windows all
422files should be written to disk).
[550]424<DT><FONT FACE="COURIER">graph(outname)</FONT><DD>
[41]425This is the default for the file name used
426when PostScript files will be written to disk.
[550]428<DT><FONT FACE="COURIER">graph(outcmd)</FONT><DD>
[41]429This is the default for the command used
430to print PostScript files (Unix only).
[550]432<DT><FONT FACE="COURIER">graph(legend)</FONT><DD>
[41]433Sets the default value for display of the legend in liveplot and widplt.
[550]435<DT><FONT FACE="COURIER">graph(plotunits)</FONT><DD>
[41]436Sets the units used for displaying the data. Values are "d", "q", "",
437for d-space, Q and 2-theta, respectively.
[550]438<DT><FONT FACE="COURIER">graph(equivwave)</FONT><DD>
[41]439Sets the wavelength used for displaying data, if blank, no conversion is
440done and data are shown in their original wavelength.
[114]444<a name="Customizing"><H2>
445Customizing Example 1: Adding a new button to the button bar
447When a LeBail extraction is used to refine lattice constants, profile
448terms, ... It is always a good idea to run GENLES a few times after running
449POWPREF. This is because GENLES sets the extracted intensities back to their
450crystallographic values, during the first GENLES cycle after POWPREF has been
451run. Refining anything until the extracted intensities return to reasonable
452values is a really bad idea. Forturnately, running GENLES with the number of
453cycles set to zero gives the Le Bail extraction a head start.
[550]455The code below can be used to define a new command, <font face="courier">leBail</font>. The first
[114]456command adds a command to the button bar and the second one defines what will
457be done when it is invoked (the number of cycles is set to zero and
458GENLES is run three times). It also defines the help entry. Note that commands must start with a lower case letter even though Armel LeBail's last name
459does not.
[114]462    lappend expgui(buttonlist) leBail
463    set expgui_cmdlist(leBail) {
464        {set entryvar(cycles) 0; runGSASwEXP "genles genles genles"}
465        {Converges GENLES with LeBail extractions;
466          Sets the number of cycles to zero and runs GENLES 3 times.}
467    }
470To make this customization, put the above in the <FONT FACE="COURIER">localconfig</FONT> 
[114]471file or the
[550]472<FONT FACE="COURIER">~/.gsas_config</FONT> or (or <FONT FACE="COURIER">C:\GSAS\EXPGUI\.gsas_config</FONT>)
[143]476Customizing Example 2: Putting DISAGL Results in a Separate Box
478Barbara Reisner has been asking me to put the output from DISAGL in a separate
[143]479window. Sounds like a pretty reasonable request. Here is an example with code
480to do that as a customization option. Please note that this has now been
481incorporated into EXPGUI, so do not use this example.
[114]483  set expgui(disaglSeparateBox) 1
484  set expgui_cmdlist(disagl) {rundisagl {Hacked Distance/angle calculations}}
485  proc rundisagl {} {
486    global expgui txtvw tcl_version tcl_platform
[143]487    if {$expgui(disaglSeparateBox) && $tcl_platform(platform) != "windows"} {
[114]488        set root [file root $expgui(expfile)]
489        catch {file rename $root.LST $root.OLS}
490        runGSASwEXP disagl
491        catch {file rename $root.LST $root.DIS}
492        catch {file rename $root.OLS $root.LST}
494        # open a new window
495        catch {toplevel .disagl}
496        catch {eval grid forget [grid slaves .disagl]}
497        text .disagl.txt -width 100 -wrap none \
498                -yscrollcommand ".disagl.yscroll set" \
499                -xscrollcommand ".disagl.xscroll set"
500        if {$tcl_version >= 8.0} {.disagl.txt config -font $txtvw(font)}
501        scrollbar .disagl.yscroll -command ".disagl.txt yview"
502        scrollbar .disagl.xscroll -command ".disagl.txt xview" -orient horizontal
503        grid .disagl.xscroll -column 0 -row 2 -sticky ew
504        grid .disagl.txt -column 0 -row 1 -sticky nsew
505        grid .disagl.yscroll -column 1 -row 1 -sticky ns
506        grid columnconfigure .disagl 0 -weight 1
507        grid rowconfigure .disagl 1 -weight 1
508        wm title .disagl "DISAGL results $expgui(expfile)"
509        wm iconname .disagl "DISAGL $root"
510        set in [open $root.DIS r]
511        .disagl.txt insert end [read $in]
512        close $in
513        bind all <Control-KeyPress-c> {destroy .disagl}
514        bind .disagl <KeyPress-Prior> ".disagl.txt yview scroll -1 page"
515        bind .disagl <KeyPress-Next> ".disagl.txt yview scroll 1 page"
516        bind .disagl <KeyPress-Right> ".disagl.txt xview scroll 1 unit"
517        bind .disagl <KeyPress-Left> ".disagl.txt xview scroll -1 unit"
518        bind .disagl <KeyPress-Up> ".disagl.txt yview scroll -1 unit"
519        bind .disagl <KeyPress-Down> ".disagl.txt yview scroll 1 unit"
520        bind .disagl <KeyPress-Home> ".disagl.txt yview 0"
521        bind .disagl <KeyPress-End> ".disagl.txt yview end"
522        # don't disable in Win as this prevents the highlighting of selected text
523        if {$tcl_platform(platform) != "windows"} {
524            .disagl.txt config -state disabled
525        }
526    } else {
527        runGSASwEXP disagl
528    }
529  }
[143]531if {$tcl_platform(platform) != "windows"} {
532  append expgui(initstring) {
533      $expgui(fm) add checkbutton  -label "DISAGL window" \
534              -variable expgui(disaglSeparateBox) -underline 0;
535  }
539To make this customization, put the above in the <FONT FACE="COURIER">localconfig</FONT> 
[114]540file or the
[550]541<FONT FACE="COURIER">~/.gsas_config</FONT> or (or <FONT FACE="COURIER">C:\GSAS\EXPGUI\.gsas_config</FONT>)
[550]544Note that the <font face="courier">expgui(initstring)</font> option became available in EXPGUI
[143]545version 1.21. (Previous versions will ignore this). This code must be executed
546after all the menus and other GUI code has been run. When executed, it
547creates a checkbutton on the Options menu to
548turn the "separate DISAGL window mode" mode on and off.
551Customizing Example 3: Adding a new page to EXPGUI
553The steps for creating support for additional functionality, implementation
554of atom constraints, is outlined here. Routines described here can be found in
[550]555file <font face="courier">atomcons.tcl</font> unless otherwise noted.
557<LI>Create a routine to read and write the appropriate records
558from the .EXP file. In this case, a new routine, constrinfo,
[550]559was added to file <font face="courier">readexp.tcl</font>.
[143]560This takes considerable care and manual testing.
561<LI>Create a routine that places the appropriate widgets into a frame
562(in this case MakeAtomsConstraintsPane). This routine will be called only once.
563Note that in this example expcons(atommaster) is defined to be the name of the
565<LI>Create a routine to display and edit the information shown in the
566frame. In this case, DisplayAtomConstraints. This routine will be called each
567time the page is displayed. Note that this routine and the previous can be
568tested in a separate toplevel until they work well.
569<LI>In this particular example, the previous frame is located on a notebook
570widget that in turn placed on a notebook page, so MakeConstraintsPane is used
571to create this inner notebook when the "Constraints" notebook page is first
572shown. This in turn calls MakeAtomsConstraintsPane and DisplayAtomConstraints.
[144]573To update this page each time it is displayed, DisplayConstraintsPane is
[550]575<LI>Edit file <font face="courier">expgui</font> to make the following changes:
[550]577<P><LI>load the <font face="courier">atomcons.tcl</font> file:
[144]579# commands for constraints
[143]580source [file join $expgui(scriptdir) atomcons.tcl]
[143]582<P><LI>Define a notebook page for the option. The -createcmd option
583is used only once, but the -raisecmd option is used every time
584the page is exposed.
[143]586set expgui(consFrame) [\
587            .n insert end consPane -text Constraints \
[144]588            -raisecmd "set expgui(pagenow) consFrame; DisplayConstraintsPane"\
[143]589            -createcmd MakeConstraintsPane]
[144]590lappend expgui(frameactionlist) "consFrame DisplayConstraintsPane"
[143]592Note that if we were displaying the atoms constraint page directly on
593the main notebook widget, the previous command would have been
[550]594<font face="courier">-raisecmd DisplayAtomConstraints -createcmd MakeAtomsConstraintsPane</font>
[144]596Since the frame will need to be updated when information in the .EXP file
597changes, the name of the frame and a command to execute are added into list
[550]598expgui(frameactionlist) using the <FONT FACE="COURIER">lappend expgui(frameactionlist)</FONT>
605Customizing Example 4: Changing the fonts used in the GUI
607<B>Question: </B>
[423]608<I>I am not happy with the fonts available via the Option/Screen Font
609menu option. Is there a way to select different font size(s)/families?
612<B>Answer: </B>
613The fonts used in EXPGUI can be customized by adding some code to the
[550]614<FONT FACE="COURIER">localconfig</FONT> file or the
615<FONT FACE="COURIER">~/.gsas_config</FONT> or (or <FONT FACE="COURIER">C:\GSAS\EXPGUI\.gsas_config</FONT>) file.
[347]616By default, fonts are 14 point for the menus, buttons, labels,... and
61712 point for the histogram and atom lists.
[423]619If you add a command like this:
[423]621option add *Coord.Listbox.Font "Courier -18 bold italic" 20
[423]624you will override the menu command and force the atom coordinates
625to be displayed at 18 points in a bold & italicied Courier font.
626(See the Tk documentation if this is not clear). The value 20 is a
627priority, which overrides the priority value of 10 in the
628standard initialization. Here are the options that can be specified:
[550]630<DT><FONT FACE="COURIER">*Graph*Font</FONT><DD>Used for Graph labels
631<DT><FONT FACE="COURIER">*Graph.font</FONT><DD>Used for Graph title
632<DT><FONT FACE="COURIER">*Canvas.font</FONT><DD>Used for notebook tabs
633<DT><FONT FACE="COURIER">*Button.font</FONT><DD>Used on most buttons
634<DT><FONT FACE="COURIER">*Menu.font</FONT><DD>Used on menu commands
635<DT><FONT FACE="COURIER">*Menubutton.font</FONT><DD>Used on "menu buttons" (e.g. Print options)
636<DT><FONT FACE="COURIER">*Label.font</FONT><DD>Used on labels
637<DT><FONT FACE="COURIER">*Scale.font</FONT><DD>Used on sliders (e.g. Marquardt damping)
638<DT><FONT FACE="COURIER">*TitleFrame.font</FONT><DD>Used on title frames (e.g. box labels such as
[423]639the "Diffractometer Constants" label
[550]640<DT><FONT FACE="COURIER">*SmallFont.Button.font</FONT><DD>Used for buttons with smaller letters
641<DT><FONT FACE="COURIER">*Coord.Listbox.font</FONT><DD>Used for coordinate listings, best as a
[423]642mono-spaced font, such as Courier
[550]643<DT><FONT FACE="COURIER">*HistList.Listbox.font</FONT><DD>Used for histogram listings
644<DT><FONT FACE="COURIER">*MonoSpc.Label.font</FONT><DD>Used in other places where a mono-spaced
[423]645font is required
[347]648It should be noted that the appearance of fonts depends on many factors --
649the fonts installed on your computer, the screen size and resolution and your
[423]650eyes, so it is wise to experiment with different values.
[144]655<A Href="">
657is written by Allen C. Larson and <A HREF="">
[67]658Robert B. Von Dreele</A>, MS-H805,
[36]659Los Alamos National Laboratory, Los Alamos, NM 87545. Problems, questions
660or kudos concerning GSAS should be sent to Robert B. Von Dreele at <A HREF=""></A>
[574]662<P>EXPGUI is written by Brian H. Toby of the NIST Center for Neutron Research,
[36]663<A HREF="MAILTO:Brian.Toby@NIST.GOV">Brian.Toby@NIST.GOV</A>.
665<P>GSAS is Copyright, 1984-1997, The Regents of the University of California.
666The GSAS software was produced under a U.S. Government contract (W-7405-ENG-36)
667by the Los Alamos National Laboratory, which is operated by the University
668of California for the U.S. Department of Energy. The U.S. Government is
669licensed to use, reproduce, and distribute this software. Permission is
670granted to the public to copy and use this software without charge, provided
671that this notice and any statement of authorship are reproduced on all
672copies. Neither the Government nor the University makes any warranty, express
673or implied, or assumes any liability or responsibility for the use of this
[574]676<P>EXPGUI is not subject to copyright. Have fun.
680<TR><TH><A  Href="expgui.html">EXPGUI top</A> 
683<P><font size=-1><A HREF=" page <?=$PHP_SELF?>">Comments, corrections or questions:</A></font><BR>
684<font size=-1><? lastmod(); ?> </font>
686$Revision: 574 $ $Date: 2009-12-04 23:08:27 +0000 (Fri, 04 Dec 2009) $
Note: See TracBrowser for help on using the repository browser.