source: trunk/doc/howdoesitwork @ 1100

Last change on this file since 1100 was 932, checked in by toby, 12 years ago

address missing files

File size: 1.6 KB
1Here is the gist of how EXPGUI works.
3* read the .exp file into exparray (expload)
4* map the phases & histograms etc with expmap (mapexp)
6Here is the tricky part:
8  * I have a set of routines (----info) that read and write various parameters
10  * To "map" values from exparray to tcl variables (so that they get updated in the exparray as one edits them), the variables are placed in
11array entryvar and array entrycmd is used to hold the command to set the value.
12  * A trace on entryvar is used to execute the appropriate entrycmd code any time a variable is set [in entvartrace]
15    set entryvar(cycles) [expinfo cycles]
16    set entrycmd(cycles) "expinfo cycles"
18    this uses expinfo cycles to get the number of ls cycles
19    if entryvar(cycles) is changed (by changing the contents of the
20    entry associated with the variable), then in entvartrace the command
21        expinfo cycles set $entryvar(cycles)
22    is executed to put the value into the exparray and flag that a change
23    has been made.
25This is why the first step is to write a ----info routine where
26        you get the value using    ---info var <otherparms>
27        and set it using           ---info var <otherparms> set value
29The next step is to map the various parameters (like P.O. axis) to unique
30array elements in entryvar & entrycmd
32And the last step is to create a GUI with various widgets that allow the user to change the appropriate values. In this way, what you change does into the .exp file as soon as you save it.
34In some cases, where there is a toplevel with a "Save Changes" & "Cancel Changes" button (e.g. Background, Constraints, changes are done a bit more straightforwardly.
Note: See TracBrowser for help on using the repository browser.