viewfile
来自「这是一个Linux下的集成开发环境」· 代码 · 共 45 行
TXT
45 行
#!/bin/sh#\exec itkwish $0# ----------------------------------------------------------------------# EXAMPLE: show "TextInfo" and "MessageInfo" widgets in action# ----------------------------------------------------------------------# COURSE: Object-Oriented Programming with [incr Tcl]# AUTHOR: Michael J. McLennan, Bell Labs Innovations# ======================================================================# Copyright (c) 1996 Lucent Technologies# ======================================================================lappend auto_path .if {[string match *color [winfo screenvisual .]]} { option add *textBackground ivory startupFile option add *MessageInfo.background DarkSeaGreen startupFile option add *TextInfo.background DarkSeaGreen startupFile option add *activeBackground ForestGreen startupFile option add *activeForeground white startupFile option add *selectForeground white startupFile option add *selectBackground ForestGreen startupFile}label .label -text "View File:"pack .label -anchor wentry .filepack .file -fill xbind .file <KeyPress-Return> {show_file [.file get]}proc show_file {file} { set cmd { set fid [open $file r] set info [read $fid] close $fid } if {[catch $cmd] == 0} { set win [TextInfo .#auto -wrap none] $win display $info } else { MessageInfo .#auto -message "Cannot read file:\n$file" }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?