1# image1.tcl -- 2# 3# This demonstration script displays two image widgets. 4# 5# RCS: @(#) $Id$ 6 7if {![info exists widgetDemo]} { 8 error "This script should be run from the \"widget\" demo." 9} 10 11package require Tk 12 13set w .image1 14catch {destroy $w} 15toplevel $w 16wm title $w "Image Demonstration #1" 17wm iconname $w "Image1" 18positionWindow $w 19 20label $w.msg -font $font -wraplength 4i -justify left -text "This demonstration displays two images, each in a separate label widget." 21pack $w.msg -side top 22 23## See Code / Dismiss buttons 24set btns [addSeeDismiss $w.buttons $w] 25pack $btns -side bottom -fill x 26 27# Main widget program sets variable tk_demoDirectory 28catch {image delete image1a} 29image create photo image1a -file [file join $tk_demoDirectory images earth.gif] 30label $w.l1 -image image1a -bd 1 -relief sunken 31 32catch {image delete image1b} 33image create photo image1b \ 34 -file [file join $tk_demoDirectory images earthris.gif] 35label $w.l2 -image image1b -bd 1 -relief sunken 36 37pack $w.l1 $w.l2 -side top -padx .5m -pady .5m 38