From: Mark B. <ma...@gm...> - 2007-05-18 11:21:50
|
This is a well known problem, reported about a year or so ago. John Hunter tried to get some help on the (TK?) mailinglist, but I don't think anybody responded. I looked into it too, but couldn't find a solution (that doesn't mean much, except for that it is not blatently obvious). It would be great if somebody would know how to fix this. Strangely enough I have written a GUI myself where I use the toolbar, and the save button works fine there. Mark > Date: Thu, 10 May 2007 13:31:18 -0600 > From: "Urvashi R.V." <urv...@gm...> > > Hi, > > When the "save" button is used on the matplotlib tkagg toolbar, it > uses the "Tk" "asksavefilename" object from the "tkFileDialog" class, > to pop up a little window that allows you to select the name and type > of file to save. This function internally calls "figure.destroy()". > and the currently active figure gets destroyed (but it is still visible > and memory is not freed). The next plot then creates a new figure > window with the same figure._num as the previous. > > see... > backend_tkagg.py : line 621 > -> class NavigationToolbar2TkAgg :: def save_figure(...) > (callback for the toolbar.bsave button) > > The "asksavefilename" function call, triggers Gcf.destroy(). This can > be seen by placing a print statement in > _pylab_helpers.py : line 16 > -> class Gcf :: def destroy(num) |