I think you are running into a thread issue. I had a problem in an processing project with drawing in an oscMessage event method. Basically, you can’t, but you can work around it. See this topic: Stumped by something simple
Let me know if I can help…