home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09962.iso / vrml / cp2b2x.exe / DATA.Z / image1.tcl < prev    next >
Text File  |  1996-04-23  |  961b  |  32 lines

  1. # image1.tcl --
  2. #
  3. # This demonstration script displays two image widgets.
  4. #
  5. # @(#) image1.tcl 1.1 95/06/21 17:32:46
  6.  
  7. set w .image1
  8. catch {destroy $w}
  9. toplevel $w
  10. wm title $w "Image Demonstration #1"
  11. wm iconname $w "Image1"
  12. positionWindow $w
  13.  
  14. label $w.msg -font $font -wraplength 4i -justify left -text "This demonstration displays two images, each in a separate label widget."
  15. pack $w.msg -side top
  16.  
  17. frame $w.buttons
  18. pack  $w.buttons -side bottom -expand y -fill x -pady 2m
  19. button $w.buttons.dismiss -text Dismiss -command "destroy $w"
  20. button $w.buttons.code -text "See Code" -command "showCode $w"
  21. pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
  22.  
  23. catch {image delete image1a}
  24. image create photo image1a -file $tk_library/demos/images/earth.gif
  25. label $w.l1 -image image1a
  26.  
  27. catch {image delete image1b}
  28. image create photo image1b -file $tk_library/demos/images/earthris.gif
  29. label $w.l2 -image image1b
  30.  
  31. pack $w.l1 $w.l2 -side top -padx .5m -pady .5m
  32.