On Sun, Aug 2, 2009 at 8:08 AM, John Hunter<jdh2...@gmail.com> wrote:

> Wriing a GUI neutal idle event handler is not easy -- I've spent some
> time on it but crashed and burned on tk -- but my guess is that the
> problem you are having in your code is that GTK expects you to return
> True is you want the func to be called again.  As soon as you return
> False the event handler is terminated.  You return nothing, which is
> None, which is False.  A simple "return True" may cure what ails you
> vis-a-vis gtk.  But pylab animation is not supported, so I suggest
> that you code to your GUI of choice for animation until we get a
> proper GUI neutral animation event API.

I should phrase this last bit differently: I would like to support
this, and spent a fair amount of time trying to get this working
properly across backends.  I think it *does* work on GTK and WX.  I
encountered some problems in tkagg: since tk does not have a native
idle event loop that I could wrap, I tried to use python threading to
implement it, and ran into problems with cross thread signal handling
(including losing CTRL-C and some strange on-exit behavior) so
commented out the code, and have not attempted qt or macosx.  I think
it would be great if we could abstract the idle handler and timeout
handler across the GUIs so that mpl animation would be easier, but to
date this has eluded me.  So in the meantime, I would stick to the API
of the GUI of your choice until we can get proper support for this as
an mpl event.

JDH

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to