source: trunk/doc/expgui_cfg.html @ 538

Last change on this file since 538 was 524, checked in by toby, 12 years ago

# on 2002/01/22 21:08:12, toby did:
add coordinate export section
minor coord. input section changes

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