# Copyright 2000 Earthstar Geographics.
#
# Script:  ESG_Unlink_All_Windows.erb
# Date:    March 2000
# Author:  Eric Augenstein (eric@es-geo.com)
# Summary: Sets all active windows to Geolink None mode.  
#	     Does this to all windows, whether they were linked or not.

include "lib/BE_Startup.erb"

if current window then goto get_last_windowid

say warning "There are no image windows open."
exit

get_last_windowid:
$winlast = last window

# Unlink the first window (by window ID number).

first window
set window geolink mode to none

unlink_other_windows:
next window

set window geolink mode to none

# Check if we're at the last window. Exit out if yes,
# or go back to continue unlinking.

$win = current window
if ($win == $winlast) then goto finished
goto unlink_other_windows

finished:
exit
