On 09.10.2009 10:00, TK Soh wrote: > Mine too. (I'm giving up arguing to do it *on hgtk* for sure, as it is sure not worth spending more time on this little issue. And it might well be that it is overkill here)
If you look at it from a bit broader view, you can see that my pattern is used in similar situations and in other languages as well (packaging up a function call into an object for later execution). You will find this pattern for example when deferring work to threads in languages like Java (see for example my favorite book "Java Concurrency in Practice" by Brian Goetz, and excellent read). GUI frameworks are single threaded and they have a single worker thread, but you need to decouple call and executions as well too at times so that pattern fits there too, as we have seen with the idle_add (similar things also appear with Java's Swing or in the .Net world on Windows). Python has the very nice aspect that everything is an object, including functions. So wrapping up a function call into an object is dead easy (in Java, you suffer RSI). Per the maintenance aspect, think of a function that starts being used as usual (direct call), then later on someone notices a problem with execution order in gtk. Then the call is wrapped into an idle_add to solve that. At that moment, you will have to add a return False to that function. It is not about the work having to be done. Adding a return False is sure not much work :) ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Tortoisehg-develop mailing list Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop