module Image where

import Tcl

images = 
   do w <- window []
      tcl_ ["wm iconname",wpath w,"Image1"]
 
      l1 <- label w [font "Helvetica 18", justify LeftJ, 
                     "wraplength" %% "4i", text msg] 
      packAdd l1 [packV]

      f <- frame w []
      packAdd f [packV,fillX,packPadY 80]

      b1 <- button w [text "Dismiss",command $ destroy w]
      packAdd b1 [expand True,packH]

      tcl_ ["image create photo imagea -file [file join images earth.gif]"] 
      tcl_ ["image create photo imageb -file [file join images earthris.gif]"]
      l1 <- label w [borderwidth 1,relief Sunken,"image" %% "imagea"] 
      l2 <- label w [borderwidth 1,relief Sunken,"image" %% "imageb"]
      packAdd l1 [packV,packPadX 20,packPadY 20]
      packAdd l2 [packV,packPadX 20,packPadY 20]

      return()

    where 

      msg = "This demonstration displays two images," ++ 
            "  each in a separate label widget."

