File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,7 @@ - (void)drawRect:(NSRect)rect;
346
346
- (void )windowDidResize : (NSNotification *)notification ;
347
347
- (View*)initWithFrame : (NSRect )rect ;
348
348
- (void )setCanvas : (PyObject*)newCanvas ;
349
+ - (void )windowWillClose : (NSNotification *)notification ;
349
350
- (BOOL )windowShouldClose : (NSNotification *)notification ;
350
351
- (BOOL )isFlipped ;
351
352
- (void )mouseEntered : (NSEvent *)event ;
@@ -4935,6 +4936,20 @@ - (void)windowDidResize: (NSNotification*)notification
4935
4936
[self setNeedsDisplay: YES ];
4936
4937
}
4937
4938
4939
+ - (void )windowWillClose : (NSNotification *)notification
4940
+ {
4941
+ PyGILState_STATE gstate;
4942
+ PyObject* result;
4943
+
4944
+ gstate = PyGILState_Ensure ();
4945
+ result = PyObject_CallMethod (canvas, " close_event" , " " );
4946
+ if (result)
4947
+ Py_DECREF (result);
4948
+ else
4949
+ PyErr_Print ();
4950
+ PyGILState_Release (gstate);
4951
+ }
4952
+
4938
4953
- (BOOL )windowShouldClose : (NSNotification *)notification
4939
4954
{
4940
4955
NSWindow * window = [self window ];
You can’t perform that action at this time.
0 commit comments