#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: bmb.tk
# Wrapped by bagwill@swe on Fri Aug 20 17:00:28 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'bmb.tk' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'bmb.tk'\"
else
echo shar: Extracting \"'bmb.tk'\" \(1374 characters\)
sed "s/^X//" >'bmb.tk' <<'END_OF_FILE'
X#!/usr/local/bin/wish -f
X# bmb - bitmap browser
X# Bob Bagwill, robert....@nist.gov
X# no warranty, no rights reserved
X
proc display {} {
X update
X set width [winfo width .f.c]
X set files [glob -nocomplain *.px *.xbm]
X if {$files == ""} {puts "No bitmaps found."; destroy .; exit}
X set x 0
X set y 0
X foreach bm $files {
X .f.c create text [expr $x+25] $y -text $bm -anchor c -tag $bm
X .f.c create bitmap $x [expr $y+25] -bitmap "@$bm" -anchor nw -tag $bm
X incr x 100
X if {$x > $width} {
X set x 0
X incr y 125
X }
X }
X
X}
X
wm minsize . 500 500
frame .f
pack append . .f {top fill expand}
X
canvas .f.c
X.f.c config -xscroll ".f.hs set" -yscroll ".f.vs set"
scrollbar .f.vs -relief sunken -command ".f.c yview"
scrollbar .f.hs -orient horiz -relief sunken -command ".f.c xview"
pack append .f .f.hs {bottom fillx} .f.vs {right filly} .f.c {expand fill}
X
display
X
X.f.c config -scrollregion [.f.c bbox all] -confine true
X
bind all <Key-q> {destroy .}
bind all <Key-s> {exec xsetroot -bitmap [lindex [.f.c gettags current] 0]}
bind .f.c <Button-2> {.f.c delete all; display}
bind .f.c <Double-Button-1> {exec bitmap [lindex [.f.c gettags current] 0] &}
bind .f.c <Button-3> {
X set bm [lindex [.f.c gettags current] 0]
X .f.c delete $bm; exec mv $bm #$bm
X}
bind .f.c <Enter> {focus .f.c}
bind .f.c <Configure> {.f.c delete all; display}
X#############
X# end of bmb
X#############
END_OF_FILE
if test 1374 -ne `wc -c <'bmb.tk'`; then
echo shar: \"'bmb.tk'\" unpacked with wrong size!
fi
chmod +x 'bmb.tk'
# end of 'bmb.tk'
fi
echo shar: End of shell archive.
exit 0
--
Bob Bagwill
bag...@swe.ncsl.nist.gov