#   weather.tcl
#   Reads weather map from National Weather Service 

source getFromWeb.tcl

# GET IMAGE FILE FROM NATIONAL WEATHER SERVICE
set URL www.wrh.noaa.gov//TotalForecast//images//Monterey.gif
getFromWeb $URL downLoaded.gif

# CREATE GRAPHICAL USER INTERFACE
image create photo weatherMap -file downLoaded.gif
label .lImage -image weatherMap
button .bExit -text Exit -command exit
button .bUpdate -text Update -command loadImage
pack .lImage 
pack .bUpdate .bExit -side left

# ROUTINE USED BY "UPDATE" BUTTON
proc loadImage { } {
  global URL

  # GET FRESH IMAGE
  getFromWeb $URL downLoaded.gif

  # DISPLAY IMAGE
  .lImage config -image weatherMap
}