# These routines handle the mouse cursor
# including the  spinning globe cursor
global HALT_WORLD_CURSOR
set HALT_WORLD_CURSOR 0 
global WORLD_CURSOR_POS
set WORLD_CURSOR_POS 0


proc worldcursor {args} {
global WORLD_CURSOR_POS
global HALT_WORLD_CURSOR
global BITMAPPATH
        if {$HALT_WORLD_CURSOR} {return}
        set wc [expr $WORLD_CURSOR_POS%7]

        foreach w $args {
		catch "$w config -cursor \"@$BITMAPPATH/w[set wc].xbm $BITMAPPATH/wmask.xbm green blue\""
        }
        incr WORLD_CURSOR_POS
        # during long waits the windows may get trashed, so...
	if {$WORLD_CURSOR_POS%30==0} {update}

        after 150 worldcursor $args
}

proc normalcursor {args} {
global HALT_WORLD_CURSOR
global WORLD_CURSOR_POS
	set HALT_WORLD_CURSOR 1
        after 200 
        foreach w $args {
	catch "$w config -cursor top_left_arrow"
        }
	after 200 {
            set HALT_WORLD_CURSOR 0 
            set WORLD_CURSOR_POS 0 
        }
}

proc watchcursor {args} {
global HALT_WORLD_CURSOR
global WORLD_CURSOR_POS
	set HALT_WORLD_CURSOR 1
        after 200 
        foreach w $args {
	catch "$w config -cursor watch"
        }
	after 200 {
            set HALT_WORLD_CURSOR 0 
            set WORLD_CURSOR_POS 0 
        }
}




