开发者

Cocoa Single View question

开发者 https://www.devze.com 2023-01-21 04:44 出处:网络
Is there a way to have a single full-screen picture load when the cocoa app is launched?What I mean by that is a full-screen picture, without the menus and stuff that cocoa automatically attaches to a

Is there a way to have a single full-screen picture load when the cocoa app is launched? What I mean by that is a full-screen picture, without the menus and stuff that cocoa automatically attaches to apps.( For example, I want to build an app that when the user clicks it - it br开发者_如何学运维ings up a picture of say, a zombie, completely full screen - kind of like the end of that maze game.)


While I'm not aware of any maze games that feature a zombie at the end (though I imagine it would be a great companion to Plants vs. Zombies), you can achieve your goal by using NSView's built-in full-screen method -enterFullScreenMode:withOptions: and exit with -exitFullScreenModeWithOptions:.

To enter full screen at launch, just use the NSApplicationDelegate method -applicationDidFinishLaunching:.

As for UI arrangement, I'd just open MainMenu.xib in Interface Builder and delete the window, then drag an NSView ("Custom View") or just a NSImageView into the IB document and open it up. Create an outlet to the view in your app delegate / app controller and connect it to the view.

0

精彩评论

暂无评论...
验证码 换一张
取 消