Changeset 232 for trunk/addcmds.tcl


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

# on 2000/07/06 21:31:38, toby did:
use short DOS names for adding histograms in Windows
Tell RAWPLOT users todo same (in RunRawplot?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    • Property rcs:date changed from 2000/06/09 03:44:05 to 2000/07/06 21:31:38
    • Property rcs:lines changed from +1 -3 to +34 -9
    • Property rcs:rev changed from 1.7 to 1.8
    r197 r232  
    224224            -command "destroy $np"] -column 1 -row 0
    225225
    226     grid [button $np.f6a -text "Run\nRAWPLOT" \
    227             -command "runGSASwEXP rawplot 1" \
    228             ] -column 4 -row 5 -rowspan 2
    229 
     226    grid [button $np.f6a -text "Run\nRAWPLOT" -command RunRawplot] \
     227            -column 4 -row 5 -rowspan 2
     228   
    230229    grid columnconfigure $np 3 -weight 1
    231 
     230   
    232231    wm title $np "add new histogram"
    233232
     
    545544
    546545proc addhist {np} {
    547     global expgui newhist
     546    global expgui newhist tcl_platform
    548547    # validate the input
    549548    set err {}
     
    583582    set fp [open exptool.in w]
    584583    puts $fp "H"
    585     puts $fp $newhist(rawfile)
    586     puts $fp $newhist(instfile)
     584    if {$tcl_platform(platform) == "windows"} {
     585        puts $fp [file attributes $newhist(rawfile) -shortname]
     586        puts $fp [file attributes $newhist(instfile) -shortname]
     587    } else {
     588        puts $fp $newhist(rawfile)
     589        puts $fp $newhist(instfile)
     590    }
    587591    puts $fp $newhist(banknum)
    588592    puts $fp $newhist(setnum)
     
    630634}
    631635
     636proc RunRawplot {} {
     637    global newhist tcl_platform
     638    # for Windows put a message on top, in case file names must be shortened
     639    if {$tcl_platform(platform) == "windows"} {
     640        set f1 {}
     641        catch {set f1 [file nativename \
     642                    [file attributes $newhist(rawfile) -shortname]]}
     643        set f2 {}
     644        catch {set f2 [file nativename \
     645                [file attributes $newhist(instfile) -shortname]]}
     646        if {$f1 != "" || $f2 != ""} {
     647            set msg "Note: input to RAWPLOT\n"
     648            if {$f1 != ""} {append msg "data file: $f1\n"}
     649            if {$f2 != ""} {append msg "instrument file: $f2"}
     650            MyMessageBox -icon info -message $msg -parent .
     651        }
     652    }
     653    # start RAWPLOT
     654    runGSASwEXP rawplot 1
     655}
     656
    632657proc MakeAddAtomsBox {phase} {
    633658    global expmap
Note: See TracChangeset for help on using the changeset viewer.