#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"

# Trivial Image Drop Displayer
#
# Use files or something to drag a supported format
# and drop in the sunken box
#

image create photo .i
label .l -image .i
label .da -text "Image Viewer" -bd 2 -relief sunken 
pack .da
pack .l -side bottom -fill both -expand y
bind .da <Drop> {
	. configure -cursor clock
	image delete .i
	image create photo .i
	if {[catch {
		.i read %D
	}] != 0} {
		puts "Invalid file type"
		.i read [file join $tk_library demos images tcllogo.gif]
	}
	. configure -cursor top_left_arrow
}
	
