| | 1396 | - (IBAction) toggleFullScreen:(id)the_sender |
| | 1397 | { |
| | 1398 | // I'm lazy and rather use the new 10.5 Cocoa Fullscreen API. |
| | 1399 | // For now, no legacy support for fullscreen. |
| | 1400 | // One of the cool things about Obj-C is dynamic/late binding. |
| | 1401 | // We can compile and run this code on versions prior to 10.5. |
| | 1402 | // At run-time, we check to see if these methods actually exist |
| | 1403 | // and if they do, we message them. If not, we avoid them. |
| | 1404 | if([self respondsToSelector:@selector(isInFullScreenMode)]) |
| | 1405 | { |
| | 1406 | if([self isInFullScreenMode]) |
| | 1407 | { |
| | 1408 | [self exitFullScreenModeWithOptions:nil]; |
| | 1409 | } |
| | 1410 | else |
| | 1411 | { |
| | 1412 | [self enterFullScreenMode:[NSScreen mainScreen] withOptions:nil]; |
| | 1413 | } |
| | 1414 | } |
| | 1415 | } |
| | 1416 | |