mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
parent
5fa3f3eb68
commit
4979a8ba3f
@ -24,6 +24,7 @@ class GraphicsEngine;
|
|||||||
|
|
||||||
- (id) initWithEngine:(GraphicsEngine *)engine;
|
- (id) initWithEngine:(GraphicsEngine *)engine;
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification;
|
- (void)applicationDidFinishLaunching:(NSNotification *)notification;
|
||||||
|
- (BOOL)applicationShouldTerminate:(NSApplication *)app;
|
||||||
- (void)applicationWillTerminate:(NSNotification *)notification;
|
- (void)applicationWillTerminate:(NSNotification *)notification;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -30,9 +30,25 @@
|
|||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)applicationShouldTerminate:(NSApplication *)app {
|
||||||
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
|
cocoadisplay_cat.debug()
|
||||||
|
<< "Received applicationShouldTerminate, closing all Cocoa windows\n";
|
||||||
|
}
|
||||||
|
// Call performClose on all the windows. This should make ShowBase shut down.
|
||||||
|
for (NSWindow *window in [app windows]) {
|
||||||
|
[window performClose:nil];
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification *)notification {
|
- (void)applicationWillTerminate:(NSNotification *)notification {
|
||||||
// The application is about to be closed, tell the graphics engine to close
|
// The application is about to be closed, tell the graphics engine to close
|
||||||
// all the windows.
|
// all the windows.
|
||||||
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
|
cocoadisplay_cat.debug()
|
||||||
|
<< "Received applicationWillTerminate, removing all windows\n";
|
||||||
|
}
|
||||||
_engine->remove_all_windows();
|
_engine->remove_all_windows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class CocoaGraphicsWindow;
|
|||||||
- (void)windowDidBecomeKey:(NSNotification *)notification;
|
- (void)windowDidBecomeKey:(NSNotification *)notification;
|
||||||
- (void)windowDidResignKey:(NSNotification *)notification;
|
- (void)windowDidResignKey:(NSNotification *)notification;
|
||||||
- (BOOL)windowShouldClose:(id)sender;
|
- (BOOL)windowShouldClose:(id)sender;
|
||||||
|
- (void)windowWillClose:(id)sender;
|
||||||
|
|
||||||
// TODO: handle fullscreen on Lion.
|
// TODO: handle fullscreen on Lion.
|
||||||
|
|
||||||
|
@ -51,11 +51,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) windowShouldClose:(id)sender {
|
- (BOOL) windowShouldClose:(id)sender {
|
||||||
bool should_close = _graphicsWindow->handle_close_request();
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
if (should_close) {
|
cocoadisplay_cat.debug()
|
||||||
_graphicsWindow->handle_close_event();
|
<< "Received windowShouldClose for window " << _graphicsWindow << "\n";
|
||||||
}
|
}
|
||||||
return should_close;
|
return _graphicsWindow->handle_close_request();
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) windowWillClose:(id)sender {
|
||||||
|
if (cocoadisplay_cat.is_debug()) {
|
||||||
|
cocoadisplay_cat.debug()
|
||||||
|
<< "Received windowWillClose for window " << _graphicsWindow << "\n";
|
||||||
|
}
|
||||||
|
_graphicsWindow->handle_close_event();
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user