On 11/13/2010 06:16 AM, Michiel de Hoon wrote: > --- On Sat, 11/13/10, John Hunter<jdh2...@gmail.com> wrote: >> Ie if we have a script like >> >> # some plotting commands >> ... >> >> # some expensive non GUI computation >> ... >> >> # some update to plot above >> ... >> >> Would we not run the risk that the GUI is idle in the non >> GUI computation and therefore trigger a draw in it's thread, >> and then do redraws again after the update code? > > In the MacOSX backend, everything is single-threaded, so this won't occur. > > I am not sufficiently familiar with the non-MacOSX backends to give a > detailed answer, but with multiple threads the "idle" refers to the Python > thread being idle rather than the GUI thread being idle. In other words, when > there are no more Python commands left to be handled, the GUI thread is > notified that it should start redrawing. >
In the gtk backend, draw_idle calls gobject.idle_add http://www.pygtk.org/pygtk2reference/gobject-functions.html#function-gobject--idle-add Thus, "idle" means the gui event loop has no higher priority events. Is this condition reached only at the end of the script? >> Are you proposing that we can get rid of the interactive setting >> entirely, always call draw on pyplot commands, and let the >> idle handler save us from doing repeated draws? Reminder: the interactive setting controls draw_if_interactive, which is what we are talking about here, but also whether or not show() blocks. So we may not need draw_if_interactive, but unless we can dispense with show entirely, we will still need an interactive setting. Returning to the issue raised by the OP, however, the question is whether the present MacOSX behavior (windows pop up) or the non-MacOSX behavior (they don't in non-interactive mode until/unless show() is called) is what we really want. It seems to me that we should preserve some way of getting this second behavior. Eric > > Yes (I assume you mean to always call draw_idle on pyplot commands). If there > are then still cases where we do get repeated draws, then that is a bug. > > Best, > --Michiel. > ------------------------------------------------------------------------------ Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users