X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8fc821cccfe0bb436095500d6f8e942bddf4412d..af5454a410ed37a8a1639716a0c96c191e60b7f0:/src/cocoa/NSWindow.mm?ds=sidebyside diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index e3c1446d78..aef1f0ead5 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -42,6 +42,7 @@ - (void)windowDidBecomeMain: (NSNotification *)notification; - (void)windowDidResignMain: (NSNotification *)notification; - (BOOL)windowShouldClose: (id)sender; +- (void)windowWillClose: (NSNotification *)notification; @end //interface wxNSWindowDelegate @implementation wxNSWindowDelegate : NSObject @@ -87,6 +88,13 @@ return YES; } +- (void)windowWillClose: (NSNotification *)notification +{ + wxCocoaNSWindow *win = wxCocoaNSWindow::GetFromCocoa([notification object]); + wxCHECK_RET(win,"windowWillClose received but no wxWindow exists"); + win->CocoaDelegate_windowWillClose(); +} + @end //implementation wxNSWindowDelegate // ============================================================================ @@ -116,6 +124,11 @@ void wxCocoaNSWindow::DisassociateNSWindow(WX_NSWindow cocoaNSWindow) } } +wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win) +{ + return NULL; +} + // ============================================================================ // @class wxPoserNSWindow // ============================================================================ @@ -123,22 +136,12 @@ void wxCocoaNSWindow::DisassociateNSWindow(WX_NSWindow cocoaNSWindow) { } -- (void)close; - (BOOL)canBecomeMainWindow; @end // wxPoserNSwindow WX_IMPLEMENT_POSER(wxPoserNSWindow); @implementation wxPoserNSWindow : NSWindow -- (void)close -{ - wxLogDebug("close"); - wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(self); - if(tlw) - tlw->Cocoa_close(); - [super close]; -} - - (BOOL)canBecomeMainWindow { bool canBecome = false;