On Apr 5, 2007, at 2:14 PM, belinda thom wrote:
>
> I do think its valuable to be able to write a blocking mouse
> function. After your pointer to Timer (which led me to the threading
> Python library) and idle handler (which I didn't find useful doc on,
> so didn't persue), I came up with the code I'll append below. My
> printing of time elapsed seems to imply the thing is working as I'd
> expect (I see times that differ by about 1 second). Problem is, I
> still get the twirling wheel of deadness on my Mac that led me to
> post my original message.

You will probably always have this problem when you do things that  
prevent the GUI's event loop from running.

Are you running your code from within iPython or as a script?

> And then I got Chris's great reply, which makes me wonder if I'm
> trying to do too much.

I'd have to agree with Chris that you are trying to do too much from  
within pylab.

> I've been using pyrorobotics, which relies heavily on Tk, but their
> plotting facilities are not great. So I started using matplotlib and
> really like it. And I ran into problems w/their Tk interface where
> windows wouldn't update correctly on the mouse unless the mouse was
> clicked in the window. Found some stuff via google implying this was
> some nasty bug on Mac, didn't find an easy work around, so now try to
> use matplotlib whenever possible, which explains my current path to
> trying to use it to provide a simple graphic interface to a python
> Connect 4 game that I wrote so my students can have fun writing
> "smart" game players in my AI course.

If that's what you're aiming for you'd probably be happier with the  
result if you write something using Tkinter's Canvas or the wxPython  
FloatCanvas.

> In Matlab, I'm used to building applications, so I was hoping it
> would be possible to do something similar in matplotlib.

Well, it's entirely possible to build applications that use  
matplotlib.  The thing to remember is that matplotlib isn't its own  
programming language or development environment -- it ties Python and  
and bunch of libraries together to provide a Matlab-like interface in  
the 'pylab' module.

> Perhaps matplotlib is not currently set up for such things (in  
> which case I'd
> like to ask if this is something you'd like to include in the future).

Although I'm matplotlib is going to continue becoming more powerful  
and flexible, I'd personally be surprised if that ever becomes one of  
the project's goals.  I obviously can't speak for anyone else, but it  
seems to me that people who want to build GUI applications using  
matplotlib should be doing so by using matplotlib from within  
Python.  I also suspect that the engineering effort involved in  
making this functionality happen might be beyond the scope of the  
project.

Ken

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to