Hm probably I understood it wrong.
However, he should code his own wait_for function, like a while which waits until iSelection is bigger then -1 or something.