I made a mistake in my original post when I said
Quote:To stop the call to pre() then use deregisterPre()
it should be unregisterPre()
PhiLo, I didn't mean my post to be a criticism of your solution I only meant to offer an alternative. For simple sketches I suspect, like you, that there is little difference between them in terms of efficiency.
I offered my solution because it offers a clear separation between updating the 'data' and drawing of that 'data', which is what I think aermartin is after.
Also aermartin said
Quote:if the user doesn't create a update there,s no need for it for him/her ,.. then the current flow of setup(); draw(); can persist.
and this can be controled using registerPre()/unregisterPre()
My final thought:
Quote:these methods are convenient for libraries, as they allow them to hook in the core of Processing life cycle.
True but then surely they are convenient for regular sketches as well?
Even though they are documented in the developers section of the Processing website they are not so complicated to use especially for more experienced programmers like aermartin