Changeset 132 for trunk/addcmds.tcl


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

# on 2000/05/17 16:14:23, toby did:
cleanup adding histograms to be prettier and to avoid paths for files
in the same directory as the .EXP (better portability)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    • Property rcs:date changed from 1999/10/11 19:49:28 to 2000/05/17 16:14:23
    • Property rcs:lines changed from +24 -8 to +20 -11
    • Property rcs:rev changed from 1.3 to 1.4
    r113 r132  
    190190            -column 0 -row 0 -sticky ew -columnspan 7
    191191    grid [label $np.l1 -text "Data file:"] -column 0 -row 1
    192     grid [label $np.t1 -textvariable newhist(rawfile)] \
    193             -column 1 -row 1 -columnspan 3
     192    grid [label $np.t1 -textvariable newhist(rawfile) -bd 2 -relief ridge] \
     193            -column 1 -row 1 -columnspan 3 -sticky ew
    194194    grid [button $np.b1 -text "Select File" \
    195195            -command "getrawfile $np" \
     
    200200
    201201    grid [label $np.l2 -text "Instrument\nParameter file:"] -column 0 -row 3
    202     grid [label $np.t2 -textvariable newhist(instfile)] \
    203             -column 1 -row 3 -columnspan 3
     202    grid [label $np.t2 -textvariable newhist(instfile) -bd 2 -relief ridge] \
     203            -column 1 -row 3 -columnspan 3 -sticky ew
    204204    grid [button $np.b2 -text "Select File" \
    205205            -command "getinstfile $np" \
     
    416416        return
    417417    }
    418     set newhist(rawfile) $inp
     418    # don't use a full path unless needed
     419    if {[pwd] == [file dirname $inp]} {
     420        set newhist(rawfile) [file tail $inp]
     421    } else {
     422        set newhist(rawfile) $inp
     423    }
    419424    foreach i $newhist(banklist) {
    420 #       pack [checkbutton $np.bank.$i -text $i \
    421 #               -variable newhist(bank$i)] -side left
    422425        pack [radiobutton $np.bank.$i -text $i \
    423426                -variable newhist(banknum) -value $i] -side left
     427        # only 1 choice, so set it
     428        if {[llength $newhist(banklist)] == 1} {set newhist(banknum) $i}
    424429    }
    425430}
     
    522527        return
    523528    }
    524     set newhist(instfile) $inp
     529    # don't use a full path unless needed
     530    if {[pwd] == [file dirname $inp]} {
     531        set newhist(instfile) [file tail $inp]
     532    } else {
     533        set newhist(instfile) $inp
     534    }
    525535    for {set i 1} {$i <= $newhist(instbanks)} {incr i} {
    526 #       pack [checkbutton $np.set.$i -text $i \
    527 #               -variable newhist(set$i)] -side left
    528536        pack [radiobutton $np.set.$i -text $i \
    529537                -variable newhist(setnum) -value $i] -side left
     538        if {$newhist(instbanks) == 1} {set newhist(setnum) $i}
    530539    }
    531540}
Note: See TracChangeset for help on using the changeset viewer.