ì子类的的NSView并启动全屏模式,当应用程序完成启动。该视图可作为财产fooView在应用程序委托。// AppDelegate.m
- (void)applicationDidFinishLaunching:(NSNotification*)notification {
[[self window] makeKeyAndOrderFront:self];
[[self fooView] enterFullScreenMode:[NSScreen mainScreen] withOptions:nil];
}
类FooView本身以下函数。// FooView.m
- (void)keyDown:(NSEvent*)event {
NSLog(@"%@ %@ - %@", self.className, NSStringFromSelector(_cmd), event);
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
}
- (void)cancelOperation:(id)sender {
NSLog(@"%@ %@ - %@", self.className, NSStringFromSelector(_cmd), sender);
[self exitFullScreenModeWithOptions:nil];
}
取消
评论