This came up regrading sliders a while ago: https://github.com/matplotlib/matplotlib/issues/3105 and is one of the persistent gotchas with animation code.
Tom On Fri Nov 07 2014 at 12:38:28 PM Benjamin Root <ben.r...@ou.edu> wrote: > Figured it out! The instance of Test() isn't being retained anywhere, so > when it goes out of scope, the garbage collector eventually gets it. The > fact that it works in py3k is likely a coincidence as the garbage collector > would eventually have cleaned it up at some point. I don't know the > scoping/garbage collection rules for lambdas, so I am guessing that they > persist as they are part of the code as opposed to a de-reference-able (is > that even a word?). Just save the instance of Test as a member variable of > App, and you should be good to go! > > Ben Root > > On Fri, Nov 7, 2014 at 10:05 AM, rouckas <stepan.rou...@gmail.com> wrote: > >> Thanks for the tip. However, subclassing from object didn't help. >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/Problem-with-event-handling-in-matplotlib-in-tkinter-tp44302p44315.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------ > ------------------ > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
------------------------------------------------------------------------------
_______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users