ginput: blocking call for mouse input

This failed for me in wx.

I posted a patch r4943 which moves flush_events from Figure to Canvas,
and removes the Yield in gui_repaint which caused an exception in wx.

The showfig callback in FigureManagerWx had an unreferenced global
variable figwin which I removed. It wasn't obvious to me why this
was broken, or how long it has been broken, but the ginput example
works for me now.

Setting the timeout to 0.01s for the busy loop in ginput seems excessive.
Since it is waiting for human interaction, generally 0.1 seconds is good
enough.

  - Paul

···

On Tue, Feb 05, 2008 at 03:58:08PM -0600, John Hunter wrote:

On Feb 2, 2008 8:48 AM, Gael Varoquaux <gael.varoquaux@...427...> wrote:

> Here is the new patch. I added visual feedback when accumulating points.
> I hope the docstrings are clear.

Great -- thanks again. I applied this patch and created a new example
ginput_demo.py

Tested on GTKAgg and TkAgg on my system, and looks good so far.

This failed for me in wx.

I posted a patch r4943 which moves flush_events from Figure to Canvas,
and removes the Yield in gui_repaint which caused an exception in wx.

The showfig callback in FigureManagerWx had an unreferenced global
variable figwin which I removed. It wasn't obvious to me why this
was broken, or how long it has been broken, but the ginput example
works for me now.

Yes, I had noticed this problem (did I signal it to the list, or did I
forget ?) I wasn't too sure what to do about it, as I don't really know
the MPL codebase. As a result I tested the principle under Wx in an older
version of MPL, which did not have this problem, but also did not have
Yield in gui_repaint. But you sorted out this problem, thanks a lot!

Setting the timeout to 0.01s for the busy loop in ginput seems excessive.
Since it is waiting for human interaction, generally 0.1 seconds is good
enough.

I had gone for that originally, but it looked quite ugly when moving the
window around. This busy waiting is quite ugly, but I have found a way of
avoid it. IMHO it should be done in the toolkit's event loop, but it
seems that trying to do it this would add gobbles of code for little
gain.

Cheers,

Ga�l

···

On Tue, Feb 05, 2008 at 06:30:53PM -0500, Paul Kienzle wrote: