home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / lib / tk / demos / image1.tcl < prev    next >
Text File  |  1998-09-09  |  984b  |  33 lines

  1. # image1.tcl --
  2. #
  3. # This demonstration script displays two image widgets.
  4. #
  5. # SCCS: @(#) image1.tcl 1.4 96/04/12 11:30:27
  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 -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 [file join $tk_library demos images earth.gif]
  25. label $w.l1 -image image1a
  26.  
  27. catch {image delete image1b}
  28. image create photo image1b \
  29.   -file [file join $tk_library demos images earthris.gif]
  30. label $w.l2 -image image1b
  31.  
  32. pack $w.l1 $w.l2 -side top -padx .5m -pady .5m
  33.