recursive grab current - raise - update



I have found this piece of code in a large application.

#bind the mose button click events to raise the child window so
#that the parent SEA window does not freeze when the child window
#gets obscured

bind all <Motion> {
set current [grab current .]
set children [winfo children .]
foreach temp $current {
raise $current
update
}
}

Same binding for <Expose>.

which generates lots of "too many nested evaluations" when some subwindows
is moved around on screen. I am a novice in Tk but the update in this proc
looks bad to me. What does the proc's do really? Can I simply delete them?

Thanks
Bo
.