Il 06/07/2010 17.32, Alan Gauld wrote:

"Francesco Loffredo" <ilcomputertraspare...@gmail.com> wrote

How can I ask a Canvas to redraw itself at my command? And if i can't,
when should I call the auto move?

You can ask the canvas to repaint itself by calling update_idle_tasks()
method.
Thank you, Alan. As many answers, this poses me a new question: why should I call update_idle_tasks() instead of update() ? What's the difference between the two methods?

But in general you shouldn't need to. It's usually better to keep
your event handlers short enough that they return to the mainloop which
will then redraw as necessary for you.
In general, I do agree. But I explained rather verbosely the peculiar situation I'm facing in my practice project: where would you put the automatic move call, if not where I did? I need an automatic move be performed at the proper moment, when it's the computer player turn.

HTH,
  SID!  (sure it did!)
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to