Changeset 745


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

# on 2003/11/13 16:05:02, toby did:
catch puts output for OSX
Resize window for OSX
revise interface to LOGIC and CMPR

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/liveplot

    • Property rcs:date changed from 2003/08/11 19:22:46 to 2003/11/13 16:05:02
    • Property rcs:lines changed from +28 -28 to +65 -12
    • Property rcs:rev changed from 1.35 to 1.36
    r725 r745  
    1414set exitstat 0
    1515set expnam [lindex $argv 0]
    16 if {$expnam == ""} {puts "error -- no experiment name"; set exitstat 1}
     16if {$expnam == ""} {catch {puts "error -- no experiment name"}; set exitstat 1}
    1717if $exitstat {
    18     puts "usage: $argv0 expnam \[hist #\] \[legend\]"
    19     destroy .
    20 }
     18    catch {puts "usage: $argv0 expnam \[hist #\] \[legend\]"}
     19    exit
     20}
     21
    2122set program [file tail $argv0]
    2223#set program bkgedit
     
    4445
    4546# default values
     47set cmprdir {};     # location for the cmpr package
    4648set weightlist {}
    4749set graph(outname) out.ps
     
    18961898        -helplink "expguierr.html Customizewarning"
    18971899}
     1900
    18981901SetTkDefaultOptions $expgui(font)
    18991902
     
    20342037        source $file
    20352038        .a.file.menu.export add command -label $label -command $action
    2036     } errmsg] {puts "error = $errmsg"}
     2039    } errmsg] {catch {puts "source error = $errmsg"}}
    20372040}
    20382041pack [menubutton .a.options -text Options -underline 0 -menu .a.options.menu] \
     
    22182221pack $box -fill both -expand yes
    22192222
    2220 # add the extra options
    2221 set fl [file join $expgui(scriptdir) icddcmd.tcl]
    2222 if [file exists $fl] {source $fl}
    2223 set fl [file join $expgui(scriptdir) cellgen.tcl]
    2224 if [file exists $fl] {source $fl}
     2223# assume cmpr is in the same location as GSAS
     2224lappend cmprdir [file join [file dirname $expgui(scriptdir)] cmpr]
     2225
     2226# append to the list a number of other likely places where CMPR might be found
     2227if {$tcl_platform(platform) == "windows"} {
     2228    lappend cmprdir c:/cmpr "c:/Program files/cmpr"
     2229} else {
     2230    lappend cmprdir /usr/local/cmpr ~/cmpr
     2231}
     2232# add the CMPR & LOGIC interface options
     2233set CMPR_OK 0
     2234foreach dir $cmprdir {
     2235    if {[file exists [set file [file join $dir cellgen.tcl]]]} {
     2236        if {[catch {source $file} errmsg]} {
     2237            catch {puts "source $file error = $errmsg"}
     2238        } else {
     2239            if {$CMPR_OK} {
     2240                catch {
     2241                    pack [menubutton .a.peaks -text "Peak Gen" \
     2242                            -underline 0 -menu .a.peaks.menu] \
     2243                            -side left   
     2244                    menu .a.peaks.menu
     2245                }
     2246                .a.peaks.menu add command -label "Display a cell" \
     2247                        -command {cellgen .cell}
     2248                break
     2249            }
     2250        }
     2251    }
     2252}
     2253
     2254set CMPR_OK 0
     2255foreach dir $cmprdir {
     2256    if {[file exists [set file [file join $dir logic icddcmd.tcl]]]} {
     2257        if {[catch {source $file} errmsg]} {
     2258            catch {puts "source $file error = $errmsg"}
     2259        } else {
     2260            if {$CMPR_OK} {
     2261                catch {
     2262                    pack [menubutton .a.peaks -text "Peak Gen" \
     2263                            -underline 0 -menu .a.peaks.menu] \
     2264                            -side left   
     2265                    menu .a.peaks.menu
     2266                }
     2267                .a.peaks.menu add command -label "Plot ICDD Entry" \
     2268                        -command MakeLogicWin
     2269                break
     2270            }
     2271        }
     2272    }
     2273}
    22252274
    22262275expload $expnam.EXP
     
    22822331            -command plotdata
    22832332    if {$program != "bkgedit"}  {
    2284         bind . <Key-$num> ".a.file.menu.tick invoke $num"
     2333        bind . <Key-$num> ".a.file.menu.tick invoke [.a.file.menu.tick index end]"
    22852334    }
    22862335    .a.options.menu.tick add command -label "Phase $num opts" \
     
    23052354bind . <Key-l> {ToggleLiveCursor}
    23062355bind . <Key-L> {ToggleLiveCursor}
     2356# seems to be needed in OSX
     2357update
     2358wm geom . [winfo reqwidth .]x[winfo reqheight .]
     2359#
    23072360updateifnew
    23082361donewaitmsg
Note: See TracChangeset for help on using the changeset viewer.