stop GTKAgg backend

Is there any way I can stop the mainloop of the gtkagg backend. i know there is a threads_leave thing but I neec the Tk object from matplotlib.
The problem is that my script doesnt continue after the window has been closed
thanks in advance
    Wolfgang

I am not exactly sure what you are after ... Do you need to use
GTKAgg at all, or can you simply set your backend to TkAgg in your
matplotlibrc and leave it at that. If for some reason you need
GTKAgg, and then need to switch to TkAgg, it may be possible to do
this with the "switch_backend" function in pylab. I have done this on
occasion with success, but it is mostly experimental. Perhaps if you
explain your use case a little better we can advise more.

···

On 8/22/07, Wolfgang Kerzendorf <wkerzendorf@...982...> wrote:

Is there any way I can stop the mainloop of the gtkagg backend. i know
there is a threads_leave thing but I neec the Tk object from matplotlib.
The problem is that my script doesnt continue after the window has been
closed

I am sorry, here the better explanation:
I have a scirpt to reduce data. from time to time it should bring up an interactive matplotlib figure and then when I close the window it should continue.it is important for me that the script actually stops when opening the window.
The problem is (which I found out just now) I am running this in ipython and if I close the window the gtk.mainloop() stays active and doesnt let me continue my script. So i'm looking for a fucntion I can call to stop the backend thread. I know there is a thread called gtk.gdk.thread_leave but I need the appropriate TK object which is the window(or matplotlib_object or whatever) to call this function. I am happy to use another backend but I am fairly new to tk and gtk in python so I didnt see anything else.
thanks in advance
   Wolfgang
John Hunter wrote:

···

On 8/22/07, Wolfgang Kerzendorf <wkerzendorf@...982...> wrote:
  

Is there any way I can stop the mainloop of the gtkagg backend. i know
there is a threads_leave thing but I neec the Tk object from matplotlib.
The problem is that my script doesnt continue after the window has been
closed
    
I am not exactly sure what you are after ... Do you need to use
GTKAgg at all, or can you simply set your backend to TkAgg in your
matplotlibrc and leave it at that. If for some reason you need
GTKAgg, and then need to switch to TkAgg, it may be possible to do
this with the "switch_backend" function in pylab. I have done this on
occasion with success, but it is mostly experimental. Perhaps if you
explain your use case a little better we can advise more.