On 10/15/10 5:16 PM, Paul Ivanov wrote: > I want to do something like this: > > import matplotlib.pyplot as plt > def onclick(event): > if event.button==1: > plt.close() > fig = plt.gcf() > cid = fig.canvas.mpl_connect('button_press_event', onclick) > plt.show() > > I've tried several variations on this theme, but all of them cause > crashes. Am I missing something? > > I'm using 1.0.0 with WXAgg > > thanks, > I don't know if MPL events do anything like this, but since you are using wx, you could probably use wx.CallAfter() (or wx.CallLater(), call one of those in your callback,a nd tehn have the function called close the figure.
-Chris ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users