Changeset 22 for trunk


Ignore:
Timestamp:
Dec 4, 2009 4:59:03 PM (14 years ago)
Author:
toby
Message:

# on 1999/01/07 04:45:54, toby did:
remove compressprog -- not used

move definition of environment variables so they are defined at runtime

move xterm errors to catch statement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsascmds.tcl

    • Property rcs:date changed from 1999/01/06 04:03:01 to 1999/01/07 04:45:54
    • Property rcs:rev changed from 1.1 to 1.2
    • Property rcs:lines set to +29 -24
    r17 r22  
    99        destroy .
    1010    }
    11     # this is a compress program used for archiving of .EXP files
    12     set compressprog "pkzip -m"
    1311    if {$tcl_platform(os) == "Windows 95" || $tcl_platform(os) == "Windows 98" } {
    1412        proc forknewterm {title command "background 0" "scrollbar 1" "wait 1"} {
    15             global expgui
     13            global env expgui
     14            # Windows environment variables
     15            # -95 does not seem to be able to use these
     16            set env(GSAS) [file nativename $expgui(gsasexe)]
     17            # PGPLOT_FONT is needed by PGPLOT
     18            set env(PGPLOT_FONT) [file nativename [file join $expgui(gsasdir) fonts grfont.dat]]
     19            # this is the number of lines/page in the .LST (etc.) file
     20            set env(LENPAGE) 60
    1621            set pwd [file nativename [pwd]]
    1722
     
    4247        # now for - brain-dead Windows-NT
    4348        proc forknewterm {title command "background 0" "scrollbar 1" "wait 1"} {
    44             # all winexec commands are background commands -- ignore background
     49            global env expgui
     50            # Windows environment variables
     51            # -95 does not seem to be able to use these
     52            set env(GSAS) [file nativename $expgui(gsasexe)]
     53            # PGPLOT_FONT is needed by PGPLOT
     54            set env(PGPLOT_FONT) [file nativename [file join $expgui(gsasdir) fonts grfont.dat]]
     55            # this is the number of lines/page in the .LST (etc.) file
     56            set env(LENPAGE) 60
     57            # all winexec commands are background commands -- ignore background arg
    4558
    4659            # can't get pause to work! -- ignore wait
     
    5871            }
    5972        }
    60         # Windows environment variables
    61         # -95 does not seem to be able to use these
    62         set env(GSAS) [file nativename $expgui(gsasexe)]
    63         # PGPLOT_FONT is needed by PGPLOT
    64         set env(PGPLOT_FONT) [file nativename [file join $expgui(gsasdir) fonts grfont.dat]]
     73    }
     74} else {
     75    if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1}
     76
     77    proc forknewterm {title command "background 0" "scrollbar 1" "wait 1"} {
     78        global env expgui
     79        # UNIX environment variables
     80        set env(GSASEXE) $expgui(gsasexe)
     81        set env(ATOMDATA) [file join $expgui(gsasdir) data atmdata.dat]
     82        set env(ATMXSECT) [file join $expgui(gsasdir) data atmxsect.dat]
     83        # PGPLOT_DIR is needed by PGPLOT
     84        set env(PGPLOT_DIR) [file join $expgui(gsasdir) pgl]
    6585        # this is the number of lines/page in the .LST (etc.) file
    6686        set env(LENPAGE) 60
    67     }
    68 } else {
    69     # UNIX environment variables
    70     set env(GSASEXE) $expgui(gsasexe)
    71     set env(ATOMDATA) [file join $expgui(gsasdir) data atmdata.dat]
    72     set env(ATMXSECT) [file join $expgui(gsasdir) data atmxsect.dat]
    73     # PGPLOT_DIR is needed by PGPLOT
    74     set env(PGPLOT_DIR) [file join $expgui(gsasdir) pgl]
    75     # this is the number of lines/page in the .LST (etc.) file
    76     set env(LENPAGE) 60
    77     if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1}
    78 
    79     # this is a compress program used for archiving of .EXP files
    80     set compressprog gzip
    81     proc forknewterm {title command "background 0" "scrollbar 1" "wait 1"} {
    82         global env
    8387        set termopts {}
    8488        if $env(GSASBACKSPACE) {
     
    101105        }
    102106        if !$background {wm iconify .}
    103         eval exec xterm $termopts -title [list $title] \
    104                 -e /bin/sh -c [list $command] $suffix
     107        catch {eval exec xterm $termopts -title [list $title] \
     108                -e /bin/sh -c [list $command] $suffix} errmsg
     109        if $expgui(debug) {puts "xterm result = $errmsg"}
    105110        if !$background {wm deiconify .}
    106111    }
Note: See TracChangeset for help on using the changeset viewer.