[wingide-users] Debugging matplotlib GUI callback

Wingware Support support at wingware.com
Thu Jul 5 10:57:29 MDT 2012


Rob Clewley wrote:
> I'm trying to debug a very simple GUI based on matplotlib / Tkinter. I
> have a mouse event callback function but I can't seem to get Wing Pro
> to stop at a breakpoint inside that callback function. The code runs
> with the same output behavior in Wing as from ipython, and I can mouse
> click etc. in the GUI window while debugging in Wing, but Wing just
> won't stop at my breakpoint. To compare, I added an explicit call to
> that function in the code on the last line and it will stop at my
> breakpoint then. Am I doing something wrong?
>
> I don't see any info about GUI callback handling in the debugger in
> the documentation, especially not for Tk.

Since it's stopping when you call it directly, it sounds somewhat like 
the callback is not being invoked as you're expecting.  I don't think 
it's possible to have two compilations of the same code, one with 
correct file name information, and the other with incorrect information 
(the most common cause for Wing to miss breakpoints).

Try adding a deliberate failure in the callback like this:

assert 0, "fail here"

This should always stop if it's reached.  Or put a print statement in to 
verify that it's being reached as you're expecting.

There's not really anything magical about callbacks as far as Wing's 
debugger is concerned, except maybe when running code in an embedded 
instance of Python (and that probably isn't the case here).

The docs for using Wing with matplotlib are here:  
http://wingware.com/doc/howtos/matplotlib

-- 

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com


More information about the wingide-users mailing list