On 8/22/07, Angus McMorland <[EMAIL PROTECTED]> wrote: > > I would like to use mpl_connect and disconnect to examine a series of 2d > > arrays in turn (with a "for" loop), one after the other: > > > > ==> at each iteration I'd like to be able to use the left mouse button > > to evaluate the sum of all x,y coordinates I select by (right) clicking > > somewhere in the present array, and then switch to the next 2d data > > array after I hit the right mouse button (button==3). I have no clue how > > to do this and the program I wrote so far is just hanging there and does > > nothing. Didn't see anything like this in the archive. > > > > Any way to get out of this? Thanks for your help. > > As a general rule of thumb, if you're using a loop like while > newoffset.stay: pass, then you're doing something wrong.
Angus is right w/ resepct to mpl -- we don't have any support for blocking calls. This is a very frequent request and you are certainly right Eric to *expect* something like this to work, but in the context of multiple GUIs w/ threads it is not too easy. One could probably make tkagg work with only minor modifications to mpl, but the other GUIs would be harder becasue they are threaded. So using event handling and callbacks are the way to solve this problem, as Angus suggests in his solution, but they are harder for people to get their head around than blocking calls, so hopefully we will get support for this idiom before the end of time. JDH ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users