Changeset 77


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

# on 1999/04/06 21:37:19, toby did:
add Id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lstview

    • Property rcs:date changed from 1999/01/21 22:42:08 to 1999/04/06 21:37:19
    • Property rcs:lines changed from +46 -7 to +31 -6
    • Property rcs:rev changed from 1.4 to 1.5
    r44 r77  
    11#!/usr/local/bin/wish
     2# $Id$
    23set Revision {$Revision$ $Date$}
    34# display a .LST file in a text box
     
    67# start work on plotting variables change next line to use
    78set plotvars 0
     9set txtvw(font) "Courier"
    810set txtvw(menulength) 25
    911set txtvw(stringcount) 0
     
    232234
    233235proc updatetext {fil {repeat 1}} {
    234     global txtvw filename
    235 
     236    global txtvw filename tcl_platform
    236237    if $repeat {after 5000 updatetext $fil}
    237238    set txt [read $fil]
     
    247248        .txt insert end $txt
    248249    }
    249     .txt config -state disabled
     250    # don't disable in Win as this prevents the highlighting of selected text
     251    if {$tcl_platform(platform) != "windows"} {
     252        .txt config -state disabled
     253    }
    250254    update idletasks
    251255    findrun .txt .a.goto.menu.run $oldend
     
    293297    set fp [open [file join ~ .gsas_config] a]
    294298    puts $fp "set txtvw(followcycle) $txtvw(followcycle)"
     299    puts $fp "set txtvw(font) [list $txtvw(font)]"
    295300    close $fp
    296301}
     
    343348        -yscrollcommand ".yscroll set" \
    344349        -xscrollcommand ".xscroll set"
    345 if {$tcl_version >= 8.0} {.txt config -font Courier}
     350if {$tcl_version >= 8.0} {.txt config -font $txtvw(font)}
    346351scrollbar .yscroll -command ".txt yview"
    347352scrollbar .xscroll -command ".txt xview" -orient horizontal
     
    359364.a.file.menu add command -label Exit -command "destroy ."
    360365
     366# windows copy command. Should not be needed in X windows
     367if {$tcl_platform(platform) == "windows"} {
     368    pack [menubutton .a.edit -text Edit -underline 0 -menu .a.edit.menu] \
     369            -side left
     370    menu .a.edit.menu
     371    .a.edit.menu add command -label copy \
     372            -command {catch {clipboard append [selection get]}}
     373}
     374
    361375pack [menubutton .a.goto -text "Go To" -underline 0 -menu .a.goto.menu] \
    362             -side left
     376        -side left
    363377menu .a.goto.menu
    364378.a.goto.menu add cascade -label "Cycle #"  -menu .a.goto.menu.cyc \
     
    381395menu .a.options.menu
    382396.a.options.menu  add checkbutton -label "Auto Advance" -variable txtvw(followcycle)
     397
     398if {$tcl_version >= 8.0} {
     399    .a.options.menu add cascade -label Font -menu .a.options.menu.font
     400    menu .a.options.menu.font
     401    foreach size {5 6 7 8 9 10 11 12 13 14 15 16} {
     402        .a.options.menu.font add command -label "Courier $size" \
     403                -command "set txtvw(font) \"Courier $size\"; \
     404                .txt config -font \$txtvw(font)"
     405    }
     406}
     407
    383408.a.options.menu add command -label "Save Options" -underline 1 \
    384409        -command "SaveOptions"
Note: See TracChangeset for help on using the changeset viewer.