Revision: 8762
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8762&view=rev
Author:   mdehoon
Date:     2010-10-23 03:34:52 +0000 (Sat, 23 Oct 2010)

Log Message:
-----------
Implement close_event in the Mac OS X native backend.

Modified Paths:
--------------
    trunk/matplotlib/src/_macosx.m

Modified: trunk/matplotlib/src/_macosx.m
===================================================================
--- trunk/matplotlib/src/_macosx.m      2010-10-22 16:20:15 UTC (rev 8761)
+++ trunk/matplotlib/src/_macosx.m      2010-10-23 03:34:52 UTC (rev 8762)
@@ -346,6 +346,7 @@
 - (void)windowDidResize:(NSNotification*)notification;
 - (View*)initWithFrame:(NSRect)rect;
 - (void)setCanvas: (PyObject*)newCanvas;
+- (void)windowWillClose:(NSNotification*)notification;
 - (BOOL)windowShouldClose:(NSNotification*)notification;
 - (BOOL)isFlipped;
 - (void)mouseEntered:(NSEvent*)event;
@@ -4935,6 +4936,20 @@
     [self setNeedsDisplay: YES];
 }
 
+- (void)windowWillClose:(NSNotification*)notification
+{
+    PyGILState_STATE gstate;
+    PyObject* result;
+
+    gstate = PyGILState_Ensure();
+    result = PyObject_CallMethod(canvas, "close_event", "");
+    if(result)
+        Py_DECREF(result);
+    else
+        PyErr_Print();
+    PyGILState_Release(gstate);
+}
+
 - (BOOL)windowShouldClose:(NSNotification*)notification
 {
     NSWindow* window = [self window];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to