Changeset 327


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

# on 2000/10/18 00:00:05, toby did:
move platform-specific runtime code from gsascmds.tcl to here so
that it gets run after the local config files are read
Switch tk_dialog to MyMessageBox? and add WWW references for soem error mgs
disable add histogram until after a phase has been added
add update idletasks to profile, so that something happens right away

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2000/10/12 21:40:40 to 2000/10/18 00:00:05
    • Property rcs:lines changed from +97 -68 to +39 -5
    • Property rcs:rev changed from 1.37 to 1.38
    r323 r327  
    3131if {$tcl_version < 8.0} {
    3232    tk_dialog .expFileErrorMsg "Version Error" \
    33             "The program requires Tcl/Tk version 8.0 or higher" error 0 "Exit"
     33            "EXPGUI requires Tcl/Tk version 8.0 or higher" error 0 "Exit"
    3434    exit
    3535}
     
    143143    source [file join ~ .gsas_config]
    144144}
     145#---------------------------------------------------------------------------
     146# platform-specific code
    145147if {$tcl_platform(platform) == "windows"} {
    146148    set expgui(exptool) [file join $expgui(gsasexe) exptool.exe]
     149    if [catch {package require winexec}] {
     150        MyMessageBox -parent . -title "WINEXEC Error" \
     151                -message "Error -- Unable to load the WINEXEC package. This is needed in Win95 machines" \
     152                -icon error -type Quit -default quit \
     153                -helplink "expgui_Win_readme.html Winexec"
     154        destroy .
     155    }
     156    if ![file exists [file join $expgui(gsasdir) fonts grfont.dat]] {
     157        MyMessageBox -parent . -title "PGPLOT Error" \
     158                -message "Warning -- Unable to find file GRFONT.DAT. GSAS graphics will not work. Is GSAS correctly installed?" \
     159                -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \
     160                -helplink "expguierr.html NoPGPLOT"
     161    }
    147162} else {
    148163    set expgui(exptool) [file join $expgui(gsasexe) exptool]
     164    if ![file exists [file join $expgui(gsasdir) pgl grfont.dat]] {
     165        MyMessageBox -parent . -title "PGPLOT Error" \
     166                -message "Warning -- Unable to find file grfont.dat. GSAS graphics will not work. Is GSAS correctly installed?" \
     167                -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \
     168                -helplink "expguierr.html NoPGPLOT"
     169    }
     170    if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1}
    149171}
    150172#---------------------------------------------------------------------------
     
    152174    if ![file exists $expgui(expfile)] {
    153175        update
    154         set ans [tk_dialog .expFileErrorMsg "File Open Error" \
    155                 "File [file tail $expgui(expfile)] does not exist in [file dirname $expgui(expfile)]" \
    156                 error 0 "Create" "Open other"]
    157         if $ans {set expgui(expfile) {}}
     176        set ans [
     177        MyMessageBox -parent . -title "File Open Error" \
     178                -message "File [file tail $expgui(expfile)] does not exist in [file dirname $expgui(expfile)]. OK to create?" \
     179                -icon question -type {"Select other" "Create"} -default "select other" \
     180                -helplink "expguierr.html OpenErr"
     181        ]
     182        if {[string tolower $ans] != "create"} {set expgui(expfile) {}}
    158183    }
    159184}
     
    12811306    if {$expgui(globalmode) == 0 && [llength $expgui(curhist)] > 1} {
    12821307        set expgui(curhist) [lindex $expgui(curhist) 0]
     1308    }
     1309
     1310    # disable the add histogram button if no phases are present
     1311    if {[llength $expmap(phaselist)] == 0} {
     1312        $expgui(histFrame).newh configure -state disabled
     1313    } else {
     1314        $expgui(histFrame).newh configure -state normal
    12831315    }
    12841316
     
    18601892    # destroy the contents of the frame
    18611893    eval destroy [winfo children $expgui(ProfileBox).f]
     1894    # since the next steps can take a while, do a screen update
     1895    update idletasks
    18621896
    18631897    if {$expgui(globalmode) == 0} {
Note: See TracChangeset for help on using the changeset viewer.