head	1.1;
access;
symbols
	itk-4-0b5:1.1
	itk-4-0b4:1.1
	itcl-3-4-b1:1.1
	itcl-ng:1.1.0.6
	itcl-3-2-1:1.1
	tclpro-1-5-0:1.1
	tclpro-1-4-1:1.1
	tclpro-1-4-0:1.1
	itcl-3-2-0:1.1
	ajuba-ajuba2-2-0:1.1
	scriptics-sc-2-0-b5:1.1
	scriptics-sc-2-0-fixed:1.1
	scriptics-sc-2-0-b2:1.1
	scriptics-sc-2-0-b1:1.1
	scriptics-sc-1-1:1.1
	scriptics-sc-1-1-b1:1.1
	scriptics-sc-1-1-branch:1.1.0.4
	scriptics-sc-1-1-base:1.1
	scriptics-sc-1-0:1.1
	scriptics-sc-1-0-branch:1.1.0.2
	scriptics-sc-1-0-base:1.1
	scriptics-bc-1-0-b1:1.1
	scriptics-tclpro-1-3-0:1.1
	scriptics-tclpro-1-3-b4:1.1
	itcl-3-1-0:1.1
	scriptics-tclpro-1-3-b3:1.1
	scriptics-tclpro-1-2:1.1
	scriptics-tclpro-1-2-b2:1.1
	scriptics-tclpro-1-2-b1:1.1
	scriptics-tclpro-1-2-a1:1.1
	itcl-3-0-1:1.1
	itcl3-0-1:1.1
	stanton:1.1;
locks; strict;
comment	@# @;


1.1
date	98.07.27.18.45.43;	author stanton;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/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 w

entry .file
pack .file -fill x

bind .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"
    }
}
@
