PRO wwassociate,tag,window_id,current=current ;+ ; WWASSOCIATE ; ; Associate a WWPICS file with a window ; ; Calling Sequence ; ; wwassociate,tag,window ; ; Arguments ; ; Tag The tag identifier for a WWPICS archived image. If set ; to "ACTIVE" then the current active image is used. ; ; Window The number of the window to associate the image with ; ; Keywords ; ; Current If set, associate the file with the current window ;- if keyword_set(current) then window_id=!d.window ; If no windows exist, cut and run if(!d.window lt 0) then return ; Find out if the requested window is registered in !w.coords, and ; get its index id used=!w_coords.windex id=where(used eq window_id) if (id(0) lt 0) then return id=id(0) ; See if an image is registered under the requested tag name ; If tag was set to "ACTIVE" this will replace it with the actual ; tag name of the image. wwpics,'check',tag,stat if (stat(0) eq 0) then return ; The tag is good and the requested window is registered, so ; associate the two !w_coords(id).tag=strupcase(tag) end