On Thu, Jan 8, 2009 at 11:05 AM, Tom Ayerst <tom.aye...@gmail.com> wrote: > The point, for me, is that Mark Engelberg's construct allowed the system to > work with no mutation
I don't yet see how that is possible. The detection of key presses has to happen in the Swing thread (by getting a call to keyPressed). That thread has to somehow make the key press known to the main thread. I see below that you are proposing that everything should happen in the Swing thread. My code uses key-code-atom to achieve communication between the Swing thread and the main thread. If there's a better way, I'm definitely interested in learning about it. > and I don't think you can do it with Swing implemented > the way it is (your latest version puts the mutation in an atom). Can you explain in more detail the issues you see with the current code? > Given that, and the problems with to threads accessing the Swing layer, I > think living in the EDT makes the most sense. For example the "everything > in the EDT" approach takes advantage of Swing's painting features and deals > with multiple events I don't remember now who suggested it, but an earlier critique of my code encouraged me to do as much processing as possible off the EDT. > while cleanly painting the board; the two thread > approach flickers terribly when the snake is short. I could be wrong, but I don't think that flicker is related to my choice of doing the painting off the EDT. I think it's just a matter of the relatively large cell size. -- R. Mark Volkmann Object Computing, Inc. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---