Mercurial > dwindows
comparison mac/dw.m @ 1018:a943f973c3ff
If there is no close event handler, the window should close by default on Mac.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 17 May 2011 23:27:33 +0000 |
parents | 2d80b4dcff9a |
children | 8188f818eb9f |
comparison
equal
deleted
inserted
replaced
1017:362e584fb3bd | 1018:a943f973c3ff |
---|---|
745 @end | 745 @end |
746 | 746 |
747 @implementation DWView | 747 @implementation DWView |
748 -(BOOL)windowShouldClose:(id)sender | 748 -(BOOL)windowShouldClose:(id)sender |
749 { | 749 { |
750 if(_event_handler(sender, nil, 6) == FALSE) | 750 if(_event_handler(sender, nil, 6) > 0) |
751 return YES; | 751 return NO; |
752 return NO; | 752 return YES; |
753 } | 753 } |
754 - (void)viewDidMoveToWindow | 754 - (void)viewDidMoveToWindow |
755 { | 755 { |
756 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowResized:) name:NSWindowDidResizeNotification object:[self window]]; | 756 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowResized:) name:NSWindowDidResizeNotification object:[self window]]; |
757 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:[self window]]; | 757 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeMain:) name:NSWindowDidBecomeMainNotification object:[self window]]; |