When you have somebody offer a treat tell them not to actually give it to him until he makes eye contact with you and you say "OK" (or whatever you want the word to be).
There are probably other methods too but that's a start.
There are probably other methods too but that's a start.