On Friday, November 1, 2013 10:00:17 AM UTC-7, Juan J. Martínez wrote: > > Just adding to Claudio's reply. > > On 01/11/13 16:17, John Ladasky wrote: > > [...] > > > > Your update method should not call sp.draw(); You always draw in the > > .draw method. > > > > > > This is interesting. How does Pyglet know that the position variables > > of a Sprite object have been changed? Where is the redrawing handled? > > In any case, I deleted the sp.draw() call in MyWindow.update(). The > > program behaved exactly as before. It ran for a while, then froze. > > Because when you do: > > sp = self.sprite > > sp holds the same object you have in self.sprite, so changing sp will > change self.sprite too (that is the one is used by on_draw). >
I am fully aware of that. I only bound a local name, sp, to the sprite to improve the readability of the next six lines of code. I didn't want to keep typing "self.sprite". My question was how simply changing the Sprite coordinate values was triggering a redraw, if I do not explicitly call on_draw(). One possible way is that a Pyglet app could keep track of the previous coordinates of any instantiated Sprites. It's great that it is accomplished automatically, if indeed it is. I just want to know how. Other GUI's that I have used do not do this. > [snip] > > > But to answer your question: on my Linux system, examples/noisy/noisy.py > > ALSO stops working, after runs of 30 seconds to a few minutes. I > > haven't tried on Windows 7 yet. > > I can't reproduce your problem with Python 3.2.3 on Linux 32-bit. > > When it "stops working", what happens? does it crash? does the app > freeze? or did the image just stop moving? > > How do you end the application when is frozen? Does "ESC" work? > > We're going to need more information with this one :) > It was in my first post: "It runs for a while, but then it hangs. The bouncing-ball Earth simply stops moving. Attempting to use the mouse to close the Pyglet window fails. The only way that I have found to close the window is to kill the Python interpreter which is running it. CPU loading is light while the animation is running, but drops to zero once the animation stops. It is as if the Pyglet clock that I defined simply stopped ticking. I added some timing features to the program (not shown) and ran it about a dozen times. The program never crashed in less than 33 seconds, no matter what else I was doing with the computer while it ran (switching to my IDE, reading my web browser, etc.). Quite a few crashes occurred quite close to that 33-second mark. The longest I got the program to run without crashing was 229 seconds. And while I can't be sure of this, in a few instances it appeared that the crashes were correlated with a mouse event. It looked like the animation stopped right as I clicked into, or away from, my Pyglet application window." I just checked the ESC key option. It too does not work, once the program is frozen. -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/groups/opt_out.
