- Timestamp:
- Dec 4, 2009 5:12:53 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lstview
- Property rcs:date changed from 2004/09/20 15:26:54 to 2005/03/24 21:43:24
- Property rcs:lines changed from +3 -2 to +49 -8
- Property rcs:rev changed from 1.17 to 1.18
r799 r837 21 21 set txtvw(sum) 0 22 22 set txtvw(hideplot) 0 23 set txtvw(printcommand) lpr 23 24 # maximum characters to read initially from a .LST file 24 25 set txtvw(maxchars) 1000000 … … 360 361 set fp [open [file join ~ .gsas_config] a] 361 362 } 362 puts $fp "# LSTVIEW saved options from [clock format [clock ticks]]" 363 puts $fp "set txtvw(followcycle) [list $txtvw(followcycle)]" 364 puts $fp "set txtvw(font) [list $txtvw(font)]" 363 puts $fp "# LSTVIEW saved options from [clock format [clock seconds]]" 364 foreach var {followcycle font printcommand} { 365 puts $fp "set txtvw($var) [list $txtvw($var)]" 366 } 365 367 close $fp 366 368 } … … 448 450 449 451 # windows copy command. Should not be needed in X windows 452 pack [menubutton .a.edit -text Edit -underline 0 -menu .a.edit.menu] \ 453 -side left 454 menu .a.edit.menu 450 455 if {$tcl_platform(platform) == "windows"} { 451 pack [menubutton .a.edit -text Edit -underline 0 -menu .a.edit.menu] \452 -side left453 menu .a.edit.menu454 456 .a.edit.menu add command -label copy \ 455 457 -command {catch {clipboard append [selection get]}} 458 } else { 459 .a.edit.menu add command -label "Print Selection" \ 460 -command {catch PrintSelection} 456 461 } 457 462 … … 490 495 } 491 496 497 if {$tcl_platform(platform) != "windows"} { 498 .a.options.menu add command -label "Set print command" -underline 1 \ 499 -command SetPrintCommand 500 } 492 501 .a.options.menu add command -label "Save Options" -underline 1 \ 493 502 -command "SaveOptions" … … 695 704 .txt see $loc 696 705 } 706 707 proc PrintSelection {} { 708 global txtvw 709 if {[catch { 710 set fp [open "| $txtvw(printcommand)" w] 711 puts $fp [selection get] 712 close $fp 713 } errmsg]} { 714 MyMessageBox -parent . -title "Print error" \ 715 -message "Error trying to print: $errmsg" \ 716 -icon warning -type Ignore -default ignore 717 # -helplink "expguierr.html Customizewarning" 718 } 719 catch {close $fp} 720 } 721 722 proc SetPrintCommand {} { 723 set bx .opt 724 catch {destroy $bx} 725 toplevel $bx 726 wm iconname $bx "Print options" 727 wm title $bx "Print options" 728 729 pack [label $bx.0 -text "Set Print Command" ] -side top 730 pack [frame $bx.c] -side top 731 pack [frame $bx.b] -side top 732 pack [label $bx.c.a -text "Command:"] -side left 733 pack [entry $bx.c.b -textvariable txtvw(printcommand) -width 40] \ 734 -side left 735 pack [button $bx.b.c -command "destroy $bx" -text Close ] -side right 736 } 737 697 738 698 739 pack [menubutton .a.help -text Help -underline 0 -menu .a.help.menu] -side right
Note: See TracChangeset
for help on using the changeset viewer.